Avoid calling size() every iteration (#2450)
authoryoni206 <yoni206@users.noreply.github.com>
Tue, 11 Sep 2018 16:30:35 +0000 (09:30 -0700)
committerAina Niemetz <aina.niemetz@gmail.com>
Tue, 11 Sep 2018 16:30:35 +0000 (09:30 -0700)
src/preprocessing/passes/global_negate.cpp

index ae71b3e789fc6c92764a257d9222e2ea8038964d..8f48d417cce5abe39907ba8b9fd0af76bc3c2e61 100644 (file)
@@ -103,7 +103,7 @@ PreprocessingPassResult GlobalNegate::applyInternal(
   NodeManager* nm = NodeManager::currentNM();
   Node simplifiedNode = simplify(assertionsToPreprocess->ref(), nm);
   Node trueNode = nm->mkConst(true);
-  for (unsigned i = 0; i < assertionsToPreprocess->size(); ++i)
+  for (unsigned i = 0, size = assertionsToPreprocess->size(); i < size; ++i)
   {
     if (i == 0)
     {