mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 20:19:20 +02:00
refactor(sonar): use try_emplace for map insertion (cpp:S6030)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ map::sorted_object_list map::objects::find_in_range(glm::vec3 from, float distan
|
||||
float dist = glm::distance2(entry_location, search_point);
|
||||
if (dist < max_distance2)
|
||||
{
|
||||
items.emplace(dist, entry);
|
||||
items.try_emplace(dist, entry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ map::sorted_object_list map::objects::find_in_range(glm::vec3 from, float distan
|
||||
auto entry = std::make_shared<map::vehicle>();
|
||||
entry->dynobj = dynobj;
|
||||
entry->name = dynobj->name();
|
||||
items.emplace(dist, std::move(entry));
|
||||
items.try_emplace(dist, std::move(entry));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user