mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 23:38:09 -05:00
chore: use const reference for assetName in GetAsset methods
This commit is contained in:
@ -169,7 +169,7 @@ XAssetInfoGeneric* GameAssetPoolIW3::AddAssetToPool(std::unique_ptr<XAssetInfoGe
|
||||
#undef CASE_ADD_TO_POOL
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW3::GetAsset(const asset_type_t type, std::string name) const
|
||||
XAssetInfoGeneric* GameAssetPoolIW3::GetAsset(const asset_type_t type, const std::string& name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
void InitPoolStatic(asset_type_t type, size_t capacity) override;
|
||||
void InitPoolDynamic(asset_type_t type) override;
|
||||
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, std::string name) const override;
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static const char* AssetTypeNameByType(asset_type_t assetType);
|
||||
_NODISCARD const char* GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
@ -200,13 +200,13 @@ XAssetInfoGeneric* GameAssetPoolIW4::AddAssetToPool(std::unique_ptr<XAssetInfoGe
|
||||
#undef CASE_ADD_TO_POOL
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, std::string name) const
|
||||
XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, const std::string& name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
return (poolName)->GetAsset(name); \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
void InitPoolStatic(asset_type_t type, size_t capacity) override;
|
||||
void InitPoolDynamic(asset_type_t type) override;
|
||||
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, std::string name) const override;
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static const char* AssetTypeNameByType(asset_type_t assetType);
|
||||
_NODISCARD const char* GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
@ -253,7 +253,7 @@ XAssetInfoGeneric* GameAssetPoolIW5::AddAssetToPool(std::unique_ptr<XAssetInfoGe
|
||||
#undef CASE_ADD_TO_POOL
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW5::GetAsset(const asset_type_t type, std::string name) const
|
||||
XAssetInfoGeneric* GameAssetPoolIW5::GetAsset(const asset_type_t type, const std::string& name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
void InitPoolStatic(asset_type_t type, size_t capacity) override;
|
||||
void InitPoolDynamic(asset_type_t type) override;
|
||||
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, std::string name) const override;
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static const char* AssetTypeNameByType(asset_type_t assetType);
|
||||
_NODISCARD const char* GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
@ -193,7 +193,7 @@ XAssetInfoGeneric* GameAssetPoolT5::AddAssetToPool(std::unique_ptr<XAssetInfoGen
|
||||
#undef CASE_ADD_TO_POOL
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolT5::GetAsset(const asset_type_t type, std::string name) const
|
||||
XAssetInfoGeneric* GameAssetPoolT5::GetAsset(const asset_type_t type, const std::string& name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
void InitPoolStatic(asset_type_t type, size_t capacity) override;
|
||||
void InitPoolDynamic(asset_type_t type) override;
|
||||
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, std::string name) const override;
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static const char* AssetTypeNameByType(asset_type_t assetType);
|
||||
_NODISCARD const char* GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
@ -294,13 +294,13 @@ XAssetInfoGeneric* GameAssetPoolT6::AddAssetToPool(std::unique_ptr<XAssetInfoGen
|
||||
#undef CASE_ADD_TO_POOL
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolT6::GetAsset(const asset_type_t type, std::string name) const
|
||||
XAssetInfoGeneric* GameAssetPoolT6::GetAsset(const asset_type_t type, const std::string& name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
return (poolName)->GetAsset(name); \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
void InitPoolStatic(asset_type_t type, size_t capacity) override;
|
||||
void InitPoolDynamic(asset_type_t type) override;
|
||||
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, std::string name) const override;
|
||||
_NODISCARD XAssetInfoGeneric* GetAsset(asset_type_t type, const std::string& name) const override;
|
||||
|
||||
static const char* AssetTypeNameByType(asset_type_t assetType);
|
||||
_NODISCARD const char* GetAssetTypeName(asset_type_t assetType) const override;
|
||||
|
Reference in New Issue
Block a user