Erik Hofman schrieb:
I had that on the back of my mind for some time now and decided to implement it today. Lines that are not needed for FlightGear are not tokenized anymore which should provide at least some speedup again.

I've also changed the if tests from strings comparison to int comparisons to speed it up just slightly more.

Unfortunately that seems to break skipping the blank lines which are in the standard apt.dat-files. I get an "Unknown line in file:"-message when the reader encounters the first blank line after the version line.

Obviously in.getline() includes the carriage return (checked that with --log-level=bulk), which was previously swallowed by simgear::strutils::split(). That way "!token.size()" could detect the empty line.

Also it seems that an empty line which consists of spaces will not be detected by the new code, but as people should not edit the apt.dat-file manually anyway, that might not be as important. One could add a note to the error message "Unknown line in file:" though.


Flightgear-devel mailing list

Reply via email to