Skip to content

Commit 6e37fdc

Browse files
osjcnerzhul
authored andcommittedJan 18, 2019
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.
1 parent 3fce27e commit 6e37fdc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎src/content/subgames.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ std::vector<SubgameSpec> getAvailableGames()
195195
{
196196
std::vector<SubgameSpec> specs;
197197
std::set<std::string> gameids = getAvailableGameIds();
198+
specs.reserve(gameids.size());
198199
for (const auto &gameid : gameids)
199200
specs.push_back(findSubgame(gameid));
200201
return specs;

0 commit comments

Comments
 (0)
Please sign in to comment.