fix: optimization: PVS-Studio warning V813

Passing large objects by const reference avoids unnecessary copying and enhances efficiency.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov
2024-08-02 05:35:55 +03:00
committed by Pugemon
parent 5b325ac2bc
commit 2c1103307f
42 changed files with 173 additions and 144 deletions
+3 -3
View File
@@ -68,8 +68,8 @@ SkeletonConfig::SkeletonConfig(const std::string& name, std::unique_ptr<Bone> ro
size_t SkeletonConfig::update(
size_t index,
Skeleton& skeleton,
Bone* node,
glm::mat4 matrix) const
Bone* node,
const glm::mat4& matrix) const
{
auto boneMatrix = skeleton.pose.matrices[index];
auto boneOffset = node->getOffset();
@@ -85,7 +85,7 @@ size_t SkeletonConfig::update(
return count;
}
void SkeletonConfig::update(Skeleton& skeleton, glm::mat4 matrix) const {
void SkeletonConfig::update(Skeleton& skeleton, const glm::mat4& matrix) const {
update(0, skeleton, root.get(), matrix);
}