replace push_back by emplace_back where possible

This commit is contained in:
Konstantinos Margaritis
2021-03-26 12:39:40 +02:00
committed by Konstantinos Margaritis
parent df769a9a9a
commit 7c6e47c95b
92 changed files with 535 additions and 535 deletions

View File

@@ -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

View File

@@ -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());

View File

@@ -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) {