From c984afdf47ef31511024c6b70bd4b4c4e64f56a6 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sat, 8 Jul 2023 23:30:25 +0500 Subject: Fixed some errors detected by static analysis --- src/RendererSectionData.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/RendererSectionData.cpp') diff --git a/src/RendererSectionData.cpp b/src/RendererSectionData.cpp index fdd961d..156d6a3 100644 --- a/src/RendererSectionData.cpp +++ b/src/RendererSectionData.cpp @@ -16,7 +16,7 @@ inline const BlockId& GetBlockId(int x, int y, int z, const std::array neCorner.y + seCorner.y) flowDirection = FaceDirection::east; else if (neCorner.y + seCorner.y > nwCorner.y + swCorner.y) @@ -373,12 +373,12 @@ void AddLiquidFacesByBlockModel(RendererSectionData& data, const BlockId& blockI } } -BlockFaces *GetInternalBlockModel(const BlockId& id, std::vector> &idModels) { +BlockFaces *GetInternalBlockModel(BlockId id, std::vector> &idModels) { for (const auto& it : idModels) { if (it.first == id) return it.second; } - idModels.push_back(std::make_pair(id, &AssetManager::GetBlockModelByBlockId(id))); + idModels.emplace_back(std::pair{ id, &AssetManager::GetBlockModelByBlockId(id) }); return idModels.back().second; } @@ -436,7 +436,6 @@ RendererSectionData ParseSection(const SectionsData §ions, bool smoothLighti std::vector> idModels; std::array blockIdData = SetBlockIdData(sections); std::array blockVisibility = GetBlockVisibilityData(sections, blockIdData, idModels); - std::string textureName; data.hash = sections.data[1][1][1].GetHash(); data.sectionPos = sections.data[1][1][1].GetPosition(); -- cgit v1.2.3