apt.dat parser: remove useless code
Remove useless code before parsing the "row code" (terminology from the apt.dat v1000 spec). The row code is parsed with atoi(), which will automatically stop at the first space found if it saw at least one digit, thus there is no need to replace it with '\0', AFAICS. One could replace the existing atoi() call with things that do better checking, but my tests showed that would be a bit slower, so I let it this way (tried with std::istringstream and strtol()).
This commit is contained in:
parent
a43786f8dd
commit
85653f04d4
1 changed files with 0 additions and 6 deletions
|
@ -118,12 +118,6 @@ public:
|
||||||
cache->setRebuildPhaseProgress(NavDataCache::REBUILD_AIRPORTS, percent);
|
cache->setRebuildPhaseProgress(NavDataCache::REBUILD_AIRPORTS, percent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.size() >= 3) {
|
|
||||||
char *p = (char *)memchr(tmp, ' ', 3);
|
|
||||||
if ( p )
|
|
||||||
*p = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
line_id = atoi(tmp);
|
line_id = atoi(tmp);
|
||||||
if ( tmp[0] == 'I' || tmp[0] == 'A' ) {
|
if ( tmp[0] == 'I' || tmp[0] == 'A' ) {
|
||||||
// First line, indicates IBM ("I") or Macintosh ("A")
|
// First line, indicates IBM ("I") or Macintosh ("A")
|
||||||
|
|
Loading…
Reference in a new issue