]> git.mxchange.org Git - flightgear.git/commitdiff
never add an untested "harmless" one-liner before committing ...
authormfranz <mfranz>
Thu, 4 Oct 2007 17:23:10 +0000 (17:23 +0000)
committermfranz <mfranz>
Thu, 4 Oct 2007 17:23:10 +0000 (17:23 +0000)
src/Airports/runways.cxx

index 89388fdb183543923a87a8e8de68d3918ea99c13..e3b45261dbe3ce62219ebc1d7edbb911b736c018 100644 (file)
@@ -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;
 }