From: mfranz Date: Thu, 4 Oct 2007 17:23:10 +0000 (+0000) Subject: never add an untested "harmless" one-liner before committing ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=70de6eac24ff045bf15dd48dfdc8eb9a7c989f57;p=flightgear.git never add an untested "harmless" one-liner before committing ... --- 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; }