1
0
Fork 0

Simplify reading of the frequency field from nav.dat files

The frequency field is always an integer, so reading it as a float to
convert it to int doesn't make sense. I've probably been confused by
field indices when I introduced this in commit a2bf424118.

This clarifies things, but shouldn't change the code behavior in any
way (unless with bogus nav.dat files, of course).
This commit is contained in:
Florent Rougon 2017-03-10 16:53:39 +01:00
parent 14611e905e
commit 99ebfcd368

View file

@ -240,9 +240,7 @@ PositionedID NavLoader::processNavLine(
lat = std::stod(fields[1]);
lon = std::stod(fields[2]);
elev_ft = std::stoi(fields[3]);
// The input data is a floating point number, but we are going to feed it
// to NavDataCache::insertNavaid(), which takes an int.
freq = static_cast<int>(std::lround(std::stof(fields[4])));
freq = std::stoi(fields[4]);
range = std::stoi(fields[5]);
multiuse = std::stod(fields[6]);
ident = fields[7];