Browse Source

Minor optimization.

DjWarmonger 10 năm trước cách đây
mục cha
commit
fe2a72f543
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      AI/VCAI/Fuzzy.cpp

+ 2 - 3
AI/VCAI/Fuzzy.cpp

@@ -539,8 +539,7 @@ SectorMap& FuzzyHelper::getCachedSectorMap(HeroPtr h)
 		return it->second;
 	else
 	{
-		cachedSectorMaps[h] = SectorMap(h);
+		cachedSectorMaps.insert (std::make_pair(h, SectorMap(h)));
+		return cachedSectorMaps[h];
 	}
-
-	return cachedSectorMaps[h];
 }