chore: use const reference for assetName in GetAsset methods

This commit is contained in:
Jan
2024-03-30 17:19:32 +01:00
parent d26fda2e92
commit e7a9e4b528
15 changed files with 19 additions and 19 deletions

View File

@ -20,7 +20,7 @@ XAssetInfoGeneric* AssetLoader::LinkAsset(std::string name,
m_asset_type, std::move(name), asset, std::move(dependencies), std::move(scriptStrings), std::move(indirectAssetReferences));
}
XAssetInfoGeneric* AssetLoader::GetAssetInfo(std::string name) const
XAssetInfoGeneric* AssetLoader::GetAssetInfo(const std::string& name) const
{
return m_zone->m_pools->GetAsset(m_asset_type, std::move(name));
return m_zone->m_pools->GetAsset(m_asset_type, name);
}

View File

@ -22,5 +22,5 @@ protected:
std::vector<scr_string_t> scriptStrings,
std::vector<IndirectAssetReference> indirectAssetReferences) const;
_NODISCARD XAssetInfoGeneric* GetAssetInfo(std::string name) const;
_NODISCARD XAssetInfoGeneric* GetAssetInfo(const std::string& name) const;
};

View File

@ -55,9 +55,9 @@ void AssetMarker::MarkArray_IndirectAssetRef(const asset_type_t type, const char
Mark_IndirectAssetRef(type, assetRefNames[index]);
}
XAssetInfoGeneric* AssetMarker::GetAssetInfoByName(std::string name) const
XAssetInfoGeneric* AssetMarker::GetAssetInfoByName(const std::string& name) const
{
return m_zone->m_pools->GetAsset(m_asset_type, std::move(name));
return m_zone->m_pools->GetAsset(m_asset_type, name);
}
std::vector<XAssetInfoGeneric*> AssetMarker::GetDependencies() const

View File

@ -26,7 +26,7 @@ protected:
void Mark_IndirectAssetRef(asset_type_t type, const char* assetRefName);
void MarkArray_IndirectAssetRef(asset_type_t type, const char** assetRefNames, size_t count);
_NODISCARD XAssetInfoGeneric* GetAssetInfoByName(std::string name) const;
_NODISCARD XAssetInfoGeneric* GetAssetInfoByName(const std::string& name) const;
Zone* m_zone;