perf: emplace elements instead of inserting temporaries

- construct container elements in place instead of inserting a temporary
- clang-tidy modernize-use-emplace
  https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-emplace.html
This commit is contained in:
Dennis Klein
2026-06-09 20:01:23 +02:00
committed by Dennis Klein
parent 0feda158b4
commit d5e0c29ced
3 changed files with 4 additions and 3 deletions

View File

@@ -513,7 +513,8 @@ void Device::HandleMultipleTransportInput()
fMultitransportProceed = true;
for (const auto& i : fMultitransportInputs) {
threads.emplace_back(thread(&Device::PollForTransport, this, fTransports.at(i.first).get(), i.second));
threads.emplace_back(
&Device::PollForTransport, this, fTransports.at(i.first).get(), i.second);
}
for (thread& t : threads) {

View File

@@ -189,7 +189,7 @@ vector<string> ProgOptions::GetPropertyKeys() const
vector<string> keys;
for (const auto& it : fVarMap) {
keys.push_back(it.first.c_str());
keys.emplace_back(it.first.c_str());
}
return keys;

View File

@@ -390,7 +390,7 @@ class Manager
}
auto* lRegion = GetRegion(id);
fTlRegionCache.fRegionsTLCache.emplace_back(std::make_tuple(lRegion, id, fShmId64));
fTlRegionCache.fRegionsTLCache.emplace_back(lRegion, id, fShmId64);
fTlRegionCache.fRegionsTLCacheGen = fRegionsGen;
return lRegion;
}