Index: trunk/BNC/bncmodel.cpp
===================================================================
--- trunk/BNC/bncmodel.cpp	(revision 2792)
+++ trunk/BNC/bncmodel.cpp	(revision 2793)
@@ -962,5 +962,4 @@
                                QMap<QString, t_satData*>& satDataGal) {
 
-
   QString prnCode;
   QString prnPhase;
@@ -971,16 +970,21 @@
   double  maxRes;
 
-  // First check Glonass
-  // -------------------
-  findMaxRes(vv,satDataGlo, prnCode, maxResCode, prnPhase, maxResPhase);
-  if (maxResPhase > MAXRES_PHASE_GLO) {
-    satDataGlo.remove(prnPhase);
-    prnRemoved = prnPhase;
-    maxRes     = maxResPhase;
-  }
-
-  // then check Galileo
-  // ------------------
-  else {
+  int irc = 0;
+
+  // Check Glonass
+  // -------------
+  if (irc == 0) {
+    findMaxRes(vv,satDataGlo, prnCode, maxResCode, prnPhase, maxResPhase);
+    if (maxResPhase > MAXRES_PHASE_GLO) {
+      satDataGlo.remove(prnPhase);
+      prnRemoved = prnPhase;
+      maxRes     = maxResPhase;
+      irc        = 1;
+    }
+  }
+
+  // Check Galileo
+  // -------------
+  if (irc == 0) {
     findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
     if      (maxResPhase > MAXRES_PHASE_GAL) {
@@ -988,4 +992,5 @@
       prnRemoved = prnPhase;
       maxRes     = maxResPhase;
+      irc        = 1;
     }
     else if (maxResCode > MAXRES_CODE_GAL) {
@@ -993,32 +998,33 @@
       prnRemoved = prnCode;
       maxRes     = maxResCode;
-    }
-
-    // and then check GPS
-    // ------------------
-    else {
-      findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
-      if      (maxResPhase > MAXRES_PHASE_GPS) {
-        satDataGPS.remove(prnPhase);
-        prnRemoved = prnPhase;
-        maxRes     = maxResPhase;
-      }
-      else if (maxResCode > MAXRES_CODE_GPS) {
-        satDataGPS.remove(prnCode);
-        prnRemoved = prnCode;
-        maxRes     = maxResCode;
-      }
+      irc        = 1;
+    }
+  }
+
+  // Check GPS
+  // ---------
+  if (irc == 0) {
+    findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
+    if      (maxResPhase > MAXRES_PHASE_GPS) {
+      satDataGPS.remove(prnPhase);
+      prnRemoved = prnPhase;
+      maxRes     = maxResPhase;
+      irc        = 1;
+    }
+    else if (maxResCode > MAXRES_CODE_GPS) {
+      satDataGPS.remove(prnCode);
+      prnRemoved = prnCode;
+      maxRes     = maxResCode;
+      irc        = 1;
     }
   }
  
-  if (!prnRemoved.isEmpty()) {
+  if (irc != 0) {
     _log += "Outlier " + prnRemoved.toAscii() + " " 
           + QByteArray::number(maxRes, 'f', 3) + "\n"; 
     _QQ = QQsav;
-    return 1;
-  }
-  else {
-    return 0;
-  }
+  }
+
+  return irc;
 }
 
