From 70de6eac24ff045bf15dd48dfdc8eb9a7c989f57 Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 4 Oct 2007 17:23:10 +0000 Subject: [PATCH] never add an untested "harmless" one-liner before committing ... --- src/Airports/runways.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 89388fdb1..e3b45261d 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -237,7 +237,9 @@ string FGRunwayList::search( const string& aptid, const int hdg ) { double max = 0.0; bool reversed = false; - while (r._id == aptid) { + do { + if (r._id != aptid) + break; if (r._type != "runway") continue; @@ -283,9 +285,7 @@ string FGRunwayList::search( const string& aptid, const int hdg ) { reversed = true; } - if (!next(&r)) - break; - } + } while (!next(&r)); return reversed ? GetReverseRunwayNo(best._rwy_no) : best._rwy_no; } -- 2.39.2