]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
ng_region: no need to copy enters
authorJustin Viiret <justin.viiret@intel.com>
Tue, 21 Mar 2017 23:56:59 +0000 (10:56 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:18:13 +0000 (15:18 +1000)
src/nfagraph/ng_region.cpp

index 6fef9aa9da71b970cf9b3cac9a3644a4472a5aaf..91904b4662959a2611e2eb916361541bb7b4a38a 100644 (file)
@@ -194,7 +194,9 @@ void buildInitialCandidate(const AcyclicGraph &g,
         return;
     }
 
-    auto enters = exits.front().open; // copy
+    // Note: findExits() will clear exits, so it's safe to mutate/move its
+    // elements here.
+    auto &enters = exits.front().open;
     candidate.clear();
 
     for (; it != ite; ++it) {