]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Fix the flattenOneLevel function as per r294
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Wed, 12 May 2010 13:49:05 +0000 (13:49 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Wed, 12 May 2010 13:49:05 +0000 (13:49 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@759 e59a4935-1847-0410-ae03-e826735625c1

src/simplifier/simplifier.cpp

index d05e1ac42cff89425c1b69f742e95ef72245477d..f3d8256c0b0a1f604db715500c38a1aa67b17f4c 100644 (file)
@@ -19,7 +19,7 @@ namespace BEEV
     ASTNode n = a;
     while (true)
       {
-        ASTNode& nold = n;
+        ASTNode nold = n;
         n = FlattenOneLevel(n);
         if ((n == nold))
           break;
@@ -1348,7 +1348,7 @@ namespace BEEV
   //one level deep flattening
   ASTNode Simplifier::FlattenOneLevel(const ASTNode& a)
   {
-    Kind k = a.GetKind();
+    const Kind k = a.GetKind();
     if (!(BVPLUS == k || AND == k || OR == k
           //|| BVAND == k
           //|| BVOR == k
@@ -1364,14 +1364,14 @@ namespace BEEV
     //       return output;
     //     }
 
-    ASTVec c = a.GetChildren();
+    const ASTVec& c = a.GetChildren();
     ASTVec o;
-    for (ASTVec::iterator it = c.begin(), itend = c.end(); it != itend; it++)
+    for (ASTVec::const_iterator it = c.begin(), itend = c.end(); it != itend; it++)
       {
-        ASTNode aaa = *it;
+        const ASTNode& aaa = *it;
         if (k == aaa.GetKind())
           {
-            ASTVec ac = aaa.GetChildren();
+            const ASTVec& ac = aaa.GetChildren();
             o.insert(o.end(), ac.begin(), ac.end());
           }
         else