mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +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:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user