fix: optimization: PVS-Studio warning V823
Replaced 'push_back' with 'emplace_back' for better performance in containers. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
committed by
MihailRis
parent
35ef339b0c
commit
a20ffee7cb
@@ -214,7 +214,7 @@ std::vector<std::string> ResPaths::listdirRaw(const std::string& folderName) con
|
||||
continue;
|
||||
for (const auto& entry : fs::directory_iterator(folder)) {
|
||||
auto name = entry.path().filename().u8string();
|
||||
entries.push_back(root.name+":"+folderName+"/"+name);
|
||||
entries.emplace_back(root.name+":"+folderName+"/"+name);
|
||||
}
|
||||
}
|
||||
{
|
||||
@@ -223,7 +223,7 @@ std::vector<std::string> ResPaths::listdirRaw(const std::string& folderName) con
|
||||
return entries;
|
||||
for (const auto& entry : fs::directory_iterator(folder)) {
|
||||
auto name = entry.path().filename().u8string();
|
||||
entries.push_back("core:"+folderName+"/"+name);
|
||||
entries.emplace_back("core:"+folderName+"/"+name);
|
||||
}
|
||||
}
|
||||
return entries;
|
||||
|
||||
Reference in New Issue
Block a user