mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01: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
@ -195,6 +195,7 @@ std::vector<SubgameSpec> getAvailableGames()
|
||||
{
|
||||
std::vector<SubgameSpec> specs;
|
||||
std::set<std::string> gameids = getAvailableGameIds();
|
||||
specs.reserve(gameids.size());
|
||||
for (const auto &gameid : gameids)
|
||||
specs.push_back(findSubgame(gameid));
|
||||
return specs;
|
||||
|
Loading…
Reference in New Issue
Block a user