]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
more std::move fixes 179/head
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 3 Oct 2023 18:01:51 +0000 (21:01 +0300)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 3 Oct 2023 18:01:51 +0000 (21:01 +0300)
tools/hscollider/GraphTruth.cpp
tools/hscollider/NfaGeneratedCorpora.cpp
tools/hscollider/UltimateTruth.cpp
tools/hscollider/main.cpp

index 6069ff5cb4a90d523ddbb57e51ed7e907b49847a..bd18d655a6fc489c6d0b0815878265973cc36d73 100644 (file)
@@ -133,7 +133,7 @@ void CNGInfo::compile() {
             auto pl = std::make_unique<ParsedLogical>();
             pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL);
             pl->logicalKeyRenumber();
-            cng = make_unique<CompiledNG>(move(pl));
+            cng = make_unique<CompiledNG>(std::move(pl));
             return;
         }
 
@@ -192,7 +192,7 @@ void CNGInfo::compile() {
             }
         }
 
-        cng = make_unique<CompiledNG>(move(g), move(rm));
+        cng = make_unique<CompiledNG>(std::move(g), std::move(rm));
     } catch (CompileError &e) {
         throw NGCompileFailure(e.reason);
     } catch (NGUnsupportedFailure &e) {
index 4de320e172e0707b2f5bfb2206665c4e8be18227..07213889957702243aeacedc2cd725adf8b56b90 100644 (file)
@@ -107,7 +107,7 @@ void NfaGeneratedCorpora::generate(unsigned id, vector<Corpus> &data) {
             a_subid = it.first;
             vector<Corpus> sub_data;
             generate(a_subid, sub_data);
-            m_data.emplace(a_subid, move(sub_data));
+            m_data.emplace(a_subid, std::move(sub_data));
         }
         assert(!m_data.empty());
         size_t num_corpus = m_data[a_subid].size();
index c448b780cd00f72618cd2001c972d9eb1cb9ce71..93d432c30a5d512f5a26fde2863e1bd1d537a4a7 100644 (file)
@@ -1079,7 +1079,7 @@ shared_ptr<BaseDB> UltimateTruth::compile(const set<unsigned> &ids,
         }
     }
 
-    return move(db);
+    return std::move(db);
 }
 
 bool UltimateTruth::allocScratch(shared_ptr<const BaseDB> db) {
index 7c0719032ee6e47fc6f819e5082621e44b079982..dcc5c1b696d92ffd68df109081be96943c7ccd6f 100644 (file)
@@ -1188,7 +1188,7 @@ struct CorpusGenUnit {
     CorpusGenUnit(unique_ptr<CNGInfo> cngi_in, unique_ptr<CompiledPcre> pcre_in,
                shared_ptr<DatabaseProxy> ue2_in, unsigned expr_id,
                bool multi_in, bool utf8_in)
-        : cngi(move(cngi_in)), pcre(move(pcre_in)), ue2(ue2_in), id(expr_id),
+        : cngi(std::move(cngi_in)), pcre(std::move(pcre_in)), ue2(ue2_in), id(expr_id),
           multi(multi_in), utf8(utf8_in) {}
 
     unique_ptr<CNGInfo> cngi;
@@ -1220,7 +1220,7 @@ public:
             }
 
             addCorporaToQueue(out, testq, c->id, *corpora, summary,
-                              move(c->pcre), move(c->cngi), c->ue2, c->multi,
+                              std::move(c->pcre), std::move(c->cngi), c->ue2, c->multi,
                               c->utf8);
 
             count++;
@@ -1434,7 +1434,7 @@ unique_ptr<CorpusGenUnit> makeCorpusGenUnit(unsigned id, TestSummary &summary,
     // Caller may already have set the UTF-8 property (in multi cases)
     utf8 |= cpcre ? cpcre->utf8 : cngi->utf8;
 
-    return std::make_unique<CorpusGenUnit>(move(cngi), move(cpcre), ue2, id,
+    return std::make_unique<CorpusGenUnit>(std::move(cngi), std::move(cpcre), ue2, id,
                                            multi, utf8);
 }
 
@@ -1489,7 +1489,7 @@ void buildSingle(BoundedQueue<CorpusGenUnit> &corpq, TestSummary &summary,
         auto u = makeCorpusGenUnit(id, summary, ground, graph, ultimate, ue2,
                                    multi, utf8);
         if (u) {
-            corpq.push(move(u));
+            corpq.push(std::move(u));
         }
     }
 }
@@ -1547,7 +1547,7 @@ void buildBanded(BoundedQueue<CorpusGenUnit> &corpq, TestSummary &summary,
             auto u = makeCorpusGenUnit(id, summary, ground, graph, ultimate,
                                        ue2, multi, utf8);
             if (u) {
-                corpq.push(move(u));
+                corpq.push(std::move(u));
             }
         }
     }
@@ -1587,7 +1587,7 @@ void buildMulti(BoundedQueue<CorpusGenUnit> &corpq, TestSummary &summary,
         auto u = makeCorpusGenUnit(id, summary, ground, graph, ultimate, ue2,
                                    multi, utf8);
         if (u) {
-            corpq.push(move(u));
+            corpq.push(std::move(u));
         }
     }
 }
@@ -1607,7 +1607,7 @@ void generateTests(CorporaSource &corpora_src, const ExpressionMap &exprMap,
     for (size_t i = 0; i < numGeneratorThreads; i++) {
         auto c = make_unique<CorpusGenThread>(i, testq, corpq, corpora_src);
         c->start();
-        generators.push_back(move(c));
+        generators.push_back(std::move(c));
     }
 
     if (g_ue2CompileAll && multicompile_bands) {
@@ -1830,11 +1830,11 @@ unique_ptr<CorporaSource> buildCorpora(const vector<string> &corporaFiles,
                 exit_with_fail();
             }
         }
-        return move(c); /* move allows unique_ptr<CorporaSource> conversion */
+        return std::move(c); /* move allows unique_ptr<CorporaSource> conversion */
     } else {
         auto c = std::make_unique<NfaGeneratedCorpora>(
             exprMap, corpus_gen_prop, force_utf8, force_prefilter);
-        return move(c);
+        return std::move(c);
     }
 }
 
@@ -1883,7 +1883,7 @@ bool runTests(CorporaSource &corpora_source, const ExpressionMap &exprMap,
     for (size_t i = 0; i < numScannerThreads; i++) {
         auto s = std::make_unique<ScanThread>(i, testq, exprMap, plat, grey);
         s->start();
-        scanners.push_back(move(s));
+        scanners.push_back(std::move(s));
     }
 
     generateTests(corpora_source, exprMap, summary, plat, grey, testq);