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
+2 -2
View File
@@ -18,7 +18,7 @@ public:
LineBatch(size_t capacity=4096);
~LineBatch();
inline void line(const glm::vec3 a, const glm::vec3 b, const glm::vec4 color) {
inline void line(const glm::vec3 &a, const glm::vec3 &b, const glm::vec4 &color) {
line(a.x, a.y, a.z, b.x, b.y, b.z, color.r, color.g, color.b, color.a);
}
void line(float x1, float y1, float z1, float x2, float y2, float z2,
@@ -26,7 +26,7 @@ public:
void box(float x, float y, float z, float w, float h, float d,
float r, float g, float b, float a);
inline void box(glm::vec3 xyz, glm::vec3 whd, glm::vec4 rgba) {
inline void box(const glm::vec3 &xyz, const glm::vec3 &whd, const glm::vec4 &rgba) {
box(xyz.x, xyz.y, xyz.z, whd.x, whd.y, whd.z,
rgba.r, rgba.g, rgba.b, rgba.a);
}