From 6e37fdc21d3f78c006d748103b3f9e8feeb0d49f Mon Sep 17 00:00:00 2001 From: Jozef Behran Date: Fri, 18 Jan 2019 04:47:50 -0500 Subject: 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. --- src/content/subgames.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/subgames.cpp b/src/content/subgames.cpp index 4bdd84f41..4b0e37f7c 100644 --- a/src/content/subgames.cpp +++ b/src/content/subgames.cpp @@ -195,6 +195,7 @@ std::vector getAvailableGames() { std::vector specs; std::set gameids = getAvailableGameIds(); + specs.reserve(gameids.size()); for (const auto &gameid : gameids) specs.push_back(findSubgame(gameid)); return specs; -- cgit v1.2.3