1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:53:53 +00:00

Minor efficiency fix

This commit is contained in:
scrawl 2015-03-02 22:33:37 +01:00
parent f6509fe53e
commit 17e3069896

View file

@ -465,8 +465,9 @@ namespace ESMTerrain
Terrain::LayerInfo Storage::getLayerInfo(const std::string& texture) Terrain::LayerInfo Storage::getLayerInfo(const std::string& texture)
{ {
// Already have this cached? // Already have this cached?
if (mLayerInfoMap.find(texture) != mLayerInfoMap.end()) std::map<std::string, Terrain::LayerInfo>::iterator found = mLayerInfoMap.find(texture);
return mLayerInfoMap[texture]; if (found != mLayerInfoMap.end())
return found->second;
Terrain::LayerInfo info; Terrain::LayerInfo info;
info.mParallax = false; info.mParallax = false;