summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Assets
diff options
context:
space:
mode:
authorMartino Fontana <tinozzo123@gmail.com>2026-04-06 11:37:26 +0200
committerMartino Fontana <tinozzo123@gmail.com>2026-04-17 12:39:46 +0200
commit95dec132030e72b74da6bc46966e4fe5e4e239c0 (patch)
treef4340655ebc036425e69048651ee49dec16ddc12 /Source/Core/VideoCommon/Assets
parent33f62b0f9f36a3dfccc3ecfc13358899d0cc8036 (diff)
Improve usage of std::move and const references parameters
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`. Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move. Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
Diffstat (limited to 'Source/Core/VideoCommon/Assets')
-rw-r--r--Source/Core/VideoCommon/Assets/CustomAsset.cpp4
-rw-r--r--Source/Core/VideoCommon/Assets/CustomAsset.h4
-rw-r--r--Source/Core/VideoCommon/Assets/ShaderAsset.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.cpp b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
index 7e2e817d15..c01fb3b689 100644
--- a/Source/Core/VideoCommon/Assets/CustomAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
@@ -8,8 +8,8 @@
namespace VideoCommon
{
CustomAsset::CustomAsset(std::shared_ptr<CustomAssetLibrary> library,
- const CustomAssetLibrary::AssetID& asset_id, u64 asset_handle)
- : m_owning_library(std::move(library)), m_asset_id(asset_id), m_handle(asset_handle)
+ CustomAssetLibrary::AssetID asset_id, u64 asset_handle)
+ : m_owning_library(std::move(library)), m_asset_id(std::move(asset_id)), m_handle(asset_handle)
{
}
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.h b/Source/Core/VideoCommon/Assets/CustomAsset.h
index cdf5f14e70..6fe25a7fcf 100644
--- a/Source/Core/VideoCommon/Assets/CustomAsset.h
+++ b/Source/Core/VideoCommon/Assets/CustomAsset.h
@@ -20,8 +20,8 @@ public:
using ClockType = std::chrono::steady_clock;
using TimeType = ClockType::time_point;
- CustomAsset(std::shared_ptr<CustomAssetLibrary> library,
- const CustomAssetLibrary::AssetID& asset_id, u64 session_id);
+ CustomAsset(std::shared_ptr<CustomAssetLibrary> library, CustomAssetLibrary::AssetID asset_id,
+ u64 session_id);
virtual ~CustomAsset() = default;
CustomAsset(const CustomAsset&) = delete;
CustomAsset(CustomAsset&&) = delete;
diff --git a/Source/Core/VideoCommon/Assets/ShaderAsset.cpp b/Source/Core/VideoCommon/Assets/ShaderAsset.cpp
index 04a9139212..d6ec53db6d 100644
--- a/Source/Core/VideoCommon/Assets/ShaderAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/ShaderAsset.cpp
@@ -116,7 +116,7 @@ static bool ParseShaderValue(const CustomAssetLibrary::AssetID& asset_id,
ShaderProperty::RGB rgb;
if (!ParseNumeric<float, 3>(asset_id, json_value, code_name, &rgb.value))
return false;
- *value = std::move(rgb);
+ *value = rgb;
return true;
}
else if (type == "rgba")
@@ -124,7 +124,7 @@ static bool ParseShaderValue(const CustomAssetLibrary::AssetID& asset_id,
ShaderProperty::RGBA rgba;
if (!ParseNumeric<float, 4>(asset_id, json_value, code_name, &rgba.value))
return false;
- *value = std::move(rgba);
+ *value = rgba;
return true;
}
else if (type == "bool")