sdag: simplify some logic
authorPhil Miller <mille121@illinois.edu>
Sun, 14 Aug 2011 22:14:54 +0000 (15:14 -0700)
committerPhil Miller <mille121@illinois.edu>
Wed, 17 Aug 2011 05:37:18 +0000 (22:37 -0700)
src/xlat-i/sdag/CSdagConstruct.C

index a10ece8ab568532672a95cea08ff14355af730e1..ca0b8b360229ddb1bf30a11c1435e093aa1a923f 100644 (file)
@@ -1496,20 +1496,13 @@ void SdagConstruct::setNext(SdagConstruct *n, int boe)
         SdagConstruct *cn=constructs->begin();
         if (cn==0) // empty slist
           return;
         SdagConstruct *cn=constructs->begin();
         if (cn==0) // empty slist
           return;
-        int flag = 1;
-        SdagConstruct *nextNode=constructs->next();
-        for(; nextNode != 0;) {
-          flag = 1;
-         while ((flag == 1) && (nextNode->type == SCONNECT)) {
-           nextNode = constructs->next();
-            if (nextNode == 0)
-              flag = 0;
-         }
-         if (nextNode != 0) {
-            cn->setNext(nextNode, 1);
-            cn = nextNode;
-            nextNode = constructs->next();
-         }
+
+        for(SdagConstruct *nextNode=constructs->next(); nextNode != 0; nextNode = constructs->next()) {
+         if (nextNode->type == SCONNECT)
+           continue;
+
+          cn->setNext(nextNode, 1);
+          cn = nextNode;
         }
         cn->setNext(this, 0);
       }
         }
         cn->setNext(this, 0);
       }