]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
stl'ed one more instance
authorG.E <gregory.economou@vectorcamp.gr>
Fri, 17 May 2024 20:18:55 +0000 (23:18 +0300)
committerG.E <gregory.economou@vectorcamp.gr>
Fri, 17 May 2024 20:18:55 +0000 (23:18 +0300)
src/nfagraph/ng_squash.cpp

index 96b6f80e44ec9cd8bd952da2179201607dfb6db3..24bfbdb6ed03529d04f751f51e909ec10043c819 100644 (file)
@@ -280,10 +280,8 @@ void findDerivedSquashers(const NGHolder &g, const vector<NFAVertex> &vByIndex,
                           const unordered_map<NFAVertex, u32> &region_map,
                           smgb_cache &cache) {
     deque<NFAVertex> remaining;
-    for (const auto &m : *squash) {
-        // cppcheck-suppress useStlAlgorithm
-        remaining.emplace_back(m.first);
-    }
+    auto mfirst = [](const pair<NFAVertex, NFAStateSet> &m) { return m.first; };
+    std::transform(squash->begin(), squash->end(), std::back_inserter(remaining), mfirst);
 
     while (!remaining.empty()) {
         NFAVertex v = remaining.back();