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
+4 -4
View File
@@ -149,10 +149,10 @@ class WorldRegions {
ubyte* getData(int x, int z, int layer, uint32_t& size);
regfile_ptr getRegFile(glm::ivec3 coord, bool create=true);
regfile_ptr getRegFile(const glm::ivec3& coord, bool create=true);
void closeRegFile(glm::ivec3 coord);
regfile_ptr useRegFile(glm::ivec3 coord);
regfile_ptr createRegFile(glm::ivec3 coord);
regfile_ptr useRegFile(const glm::ivec3& coord);
regfile_ptr createRegFile(const glm::ivec3& coord);
fs::path getRegionFilename(int x, int y) const;
@@ -172,7 +172,7 @@ public:
~WorldRegions();
/// @brief Put all chunk data to regions
void put(Chunk* chunk, std::vector<ubyte> entitiesData);
void put(Chunk* chunk, const std::vector<ubyte>& entitiesData);
/// @brief Store data in specified region
/// @param x chunk.x