mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
fix: optimization: PVS-Studio warning V807
Created references to avoid using repeated expressions, improving performance across multiple instances. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
3d21b7ba6a
commit
c4cc71623d
4 changed files with 18 additions and 14 deletions
|
|
@ -73,11 +73,12 @@ std::shared_ptr<Task> WorldConverter::startTask(
|
|||
[=](){return std::make_shared<ConverterWorker>(converter);},
|
||||
[=](int&) {}
|
||||
);
|
||||
while (!converter->tasks.empty()) {
|
||||
const convert_task& task = converter->tasks.front();
|
||||
auto& converterTasks = converter->tasks;
|
||||
while (!converterTasks.empty()) {
|
||||
const convert_task& task = converterTasks.front();
|
||||
auto ptr = std::make_shared<convert_task>(task);
|
||||
pool->enqueueJob(ptr);
|
||||
converter->tasks.pop();
|
||||
converterTasks.pop();
|
||||
}
|
||||
pool->setOnComplete([=]() {
|
||||
converter->write();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue