mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-10 00:02:24 +03:00
replace push_back by emplace_back where possible
This commit is contained in:
committed by
Konstantinos Margaritis
parent
df769a9a9a
commit
7c6e47c95b
@@ -494,11 +494,11 @@ map<BucketIndex, vector<LiteralIndex>> assignStringsToBuckets(
|
||||
u32 cnt = last_id - first_id;
|
||||
// long literals first for included literals checking
|
||||
for (u32 k = 0; k < cnt; k++) {
|
||||
litIds.push_back(last_id - k - 1);
|
||||
litIds.emplace_back(last_id - k - 1);
|
||||
}
|
||||
|
||||
i = j;
|
||||
buckets.push_back(litIds);
|
||||
buckets.emplace_back(litIds);
|
||||
}
|
||||
|
||||
// reverse bucket id, longer literals come first
|
||||
|
@@ -162,7 +162,7 @@ bytecode_ptr<FDRConfirm> getFDRConfirm(const vector<hwlmLiteral> &lits,
|
||||
LitInfo & li = tmpLitInfo[i];
|
||||
u32 hash = CONF_HASH_CALL(li.v, andmsk, mult, nBits);
|
||||
DEBUG_PRINTF("%016llx --> %u\n", li.v, hash);
|
||||
res2lits[hash].push_back(i);
|
||||
res2lits[hash].emplace_back(i);
|
||||
gm |= li.groups;
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ setupFullConfs(const vector<hwlmLiteral> &lits,
|
||||
if (contains(bucketToLits, b)) {
|
||||
vector<hwlmLiteral> vl;
|
||||
for (const LiteralIndex &lit_idx : bucketToLits.at(b)) {
|
||||
vl.push_back(lits[lit_idx]);
|
||||
vl.emplace_back(lits[lit_idx]);
|
||||
}
|
||||
|
||||
DEBUG_PRINTF("b %d sz %zu\n", b, vl.size());
|
||||
|
@@ -166,7 +166,7 @@ public:
|
||||
nibbleSets[i * 2] = nibbleSets[i * 2 + 1] = 0xffff;
|
||||
}
|
||||
}
|
||||
litIds.push_back(lit_id);
|
||||
litIds.emplace_back(lit_id);
|
||||
sort_and_unique(litIds);
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ void fillReinforcedTable(const map<BucketIndex,
|
||||
u8 *rtable_base, const u32 num_tables) {
|
||||
vector<u8 *> tables;
|
||||
for (u32 i = 0; i < num_tables; i++) {
|
||||
tables.push_back(rtable_base + i * RTABLE_SIZE);
|
||||
tables.emplace_back(rtable_base + i * RTABLE_SIZE);
|
||||
}
|
||||
|
||||
for (auto t : tables) {
|
||||
|
Reference in New Issue
Block a user