From 99ebfcd3683957ef8a92694f7ec81d52986a47a1 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Fri, 10 Mar 2017 16:53:39 +0100 Subject: [PATCH] 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 a2bf4241183a. This clarifies things, but shouldn't change the code behavior in any way (unless with bogus nav.dat files, of course). --- src/Navaids/navdb.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Navaids/navdb.cxx b/src/Navaids/navdb.cxx index b9646a509..5c1869dc3 100644 --- a/src/Navaids/navdb.cxx +++ b/src/Navaids/navdb.cxx @@ -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(std::lround(std::stof(fields[4]))); + freq = std::stoi(fields[4]); range = std::stoi(fields[5]); multiuse = std::stod(fields[6]); ident = fields[7];