From e8ae429ac0d4f12ecdad6088605d81de6cf67cce Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 9 Mar 2018 02:16:21 +0500 Subject: Some parsing optimizations --- src/AssetManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/AssetManager.cpp') diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 0561992..8403700 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -69,9 +69,10 @@ void AssetManager::LoadTextureResources() { LOG(INFO) << "Texture atlas id is " << textureAtlas->texture; } -TextureCoordinates AssetManager::GetTextureByAssetName(std::string AssetName) { - if (assetTextures.find(AssetName) != assetTextures.end()) - return assetTextures[AssetName]; +TextureCoordinates AssetManager::GetTextureByAssetName(const std::string &AssetName) { + auto it = assetTextures.find(AssetName); + if (it != assetTextures.end()) + return it->second; else return TextureCoordinates{-1, -1, -1, -1}; } -- cgit v1.2.3