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 -1
View File
@@ -40,7 +40,8 @@ namespace AL {
/// @param field enum value
/// @param def default value will be returned in case of error
/// @return field value or default
inline glm::vec3 getSource3f(uint source, ALenum field, glm::vec3 def={}) {
inline glm::vec3 getSource3f(uint source, ALenum field, const glm::vec3& def= {}
) {
glm::vec3 value = def;
if (source == 0)
return def;