mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
more std::move fixes
This commit is contained in:
parent
db7b23a468
commit
9a174745e4
@ -133,7 +133,7 @@ void CNGInfo::compile() {
|
|||||||
auto pl = std::make_unique<ParsedLogical>();
|
auto pl = std::make_unique<ParsedLogical>();
|
||||||
pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL);
|
pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL);
|
||||||
pl->logicalKeyRenumber();
|
pl->logicalKeyRenumber();
|
||||||
cng = make_unique<CompiledNG>(move(pl));
|
cng = make_unique<CompiledNG>(std::move(pl));
|
||||||
return;
|
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) {
|
} catch (CompileError &e) {
|
||||||
throw NGCompileFailure(e.reason);
|
throw NGCompileFailure(e.reason);
|
||||||
} catch (NGUnsupportedFailure &e) {
|
} catch (NGUnsupportedFailure &e) {
|
||||||
|
@ -107,7 +107,7 @@ void NfaGeneratedCorpora::generate(unsigned id, vector<Corpus> &data) {
|
|||||||
a_subid = it.first;
|
a_subid = it.first;
|
||||||
vector<Corpus> sub_data;
|
vector<Corpus> sub_data;
|
||||||
generate(a_subid, 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());
|
assert(!m_data.empty());
|
||||||
size_t num_corpus = m_data[a_subid].size();
|
size_t num_corpus = m_data[a_subid].size();
|
||||||
|
@ -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) {
|
bool UltimateTruth::allocScratch(shared_ptr<const BaseDB> db) {
|
||||||
|
@ -1188,7 +1188,7 @@ struct CorpusGenUnit {
|
|||||||
CorpusGenUnit(unique_ptr<CNGInfo> cngi_in, unique_ptr<CompiledPcre> pcre_in,
|
CorpusGenUnit(unique_ptr<CNGInfo> cngi_in, unique_ptr<CompiledPcre> pcre_in,
|
||||||
shared_ptr<DatabaseProxy> ue2_in, unsigned expr_id,
|
shared_ptr<DatabaseProxy> ue2_in, unsigned expr_id,
|
||||||
bool multi_in, bool utf8_in)
|
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) {}
|
multi(multi_in), utf8(utf8_in) {}
|
||||||
|
|
||||||
unique_ptr<CNGInfo> cngi;
|
unique_ptr<CNGInfo> cngi;
|
||||||
@ -1220,7 +1220,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
addCorporaToQueue(out, testq, c->id, *corpora, summary,
|
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);
|
c->utf8);
|
||||||
|
|
||||||
count++;
|
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)
|
// Caller may already have set the UTF-8 property (in multi cases)
|
||||||
utf8 |= cpcre ? cpcre->utf8 : cngi->utf8;
|
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);
|
multi, utf8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1489,7 +1489,7 @@ void buildSingle(BoundedQueue<CorpusGenUnit> &corpq, TestSummary &summary,
|
|||||||
auto u = makeCorpusGenUnit(id, summary, ground, graph, ultimate, ue2,
|
auto u = makeCorpusGenUnit(id, summary, ground, graph, ultimate, ue2,
|
||||||
multi, utf8);
|
multi, utf8);
|
||||||
if (u) {
|
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,
|
auto u = makeCorpusGenUnit(id, summary, ground, graph, ultimate,
|
||||||
ue2, multi, utf8);
|
ue2, multi, utf8);
|
||||||
if (u) {
|
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,
|
auto u = makeCorpusGenUnit(id, summary, ground, graph, ultimate, ue2,
|
||||||
multi, utf8);
|
multi, utf8);
|
||||||
if (u) {
|
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++) {
|
for (size_t i = 0; i < numGeneratorThreads; i++) {
|
||||||
auto c = make_unique<CorpusGenThread>(i, testq, corpq, corpora_src);
|
auto c = make_unique<CorpusGenThread>(i, testq, corpq, corpora_src);
|
||||||
c->start();
|
c->start();
|
||||||
generators.push_back(move(c));
|
generators.push_back(std::move(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_ue2CompileAll && multicompile_bands) {
|
if (g_ue2CompileAll && multicompile_bands) {
|
||||||
@ -1830,11 +1830,11 @@ unique_ptr<CorporaSource> buildCorpora(const vector<string> &corporaFiles,
|
|||||||
exit_with_fail();
|
exit_with_fail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return move(c); /* move allows unique_ptr<CorporaSource> conversion */
|
return std::move(c); /* move allows unique_ptr<CorporaSource> conversion */
|
||||||
} else {
|
} else {
|
||||||
auto c = std::make_unique<NfaGeneratedCorpora>(
|
auto c = std::make_unique<NfaGeneratedCorpora>(
|
||||||
exprMap, corpus_gen_prop, force_utf8, force_prefilter);
|
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++) {
|
for (size_t i = 0; i < numScannerThreads; i++) {
|
||||||
auto s = std::make_unique<ScanThread>(i, testq, exprMap, plat, grey);
|
auto s = std::make_unique<ScanThread>(i, testq, exprMap, plat, grey);
|
||||||
s->start();
|
s->start();
|
||||||
scanners.push_back(move(s));
|
scanners.push_back(std::move(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
generateTests(corpora_source, exprMap, summary, plat, grey, testq);
|
generateTests(corpora_source, exprMap, summary, plat, grey, testq);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user