mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Optimize subgames search a little bit (#8096)
Reserve space for the list of games in findWorldSubgame. The performance gain is pretty much negligible but this change also gets rid of a performance warning by CLANG TIDY.
This commit is contained in:
parent
3fce27ece5
commit
6e37fdc21d
1 changed files with 1 additions and 0 deletions
|
@ -195,6 +195,7 @@ std::vector<SubgameSpec> getAvailableGames()
|
||||||
{
|
{
|
||||||
std::vector<SubgameSpec> specs;
|
std::vector<SubgameSpec> specs;
|
||||||
std::set<std::string> gameids = getAvailableGameIds();
|
std::set<std::string> gameids = getAvailableGameIds();
|
||||||
|
specs.reserve(gameids.size());
|
||||||
for (const auto &gameid : gameids)
|
for (const auto &gameid : gameids)
|
||||||
specs.push_back(findSubgame(gameid));
|
specs.push_back(findSubgame(gameid));
|
||||||
return specs;
|
return specs;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue