Skip to content

Commit

Permalink
Optimize subgames search a little bit (#8096)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
osjc authored and nerzhul committed Jan 18, 2019
1 parent 3fce27e commit 6e37fdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/content/subgames.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 6e37fdc

Please sign in to comment.