Skip to content
Permalink
Browse files

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.
  • Loading branch information...
osjc authored and nerzhul committed Jan 18, 2019
1 parent 3fce27e commit 6e37fdc21d3f78c006d748103b3f9e8feeb0d49f
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/content/subgames.cpp
@@ -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;

0 comments on commit 6e37fdc

Please sign in to comment.
You can’t perform that action at this time.