From 795c0abcc865f139daf5e44cb89e54bf8b110673 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Tue, 23 Aug 2022 14:10:00 +0300 Subject: [PATCH] Apply modernize-loop-convert to the simplified loop --- code/AssetLib/SMD/SMDLoader.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/code/AssetLib/SMD/SMDLoader.cpp b/code/AssetLib/SMD/SMDLoader.cpp index 4ff6234c2..1a860568a 100644 --- a/code/AssetLib/SMD/SMDLoader.cpp +++ b/code/AssetLib/SMD/SMDLoader.cpp @@ -242,16 +242,14 @@ void SMDImporter::CreateOutputMeshes() { // collect all faces iNum = 0; - for (std::vector::const_iterator - iFace = asTriangles.begin(); - iFace != asTriangles.end(); ++iFace) { - if (UINT_MAX == (*iFace).iTexture) { - aaiFaces[(*iFace).iTexture].push_back( 0 ); - } else if ((*iFace).iTexture >= aszTextures.size()) { + for (const auto &asTriangle : asTriangles) { + if (UINT_MAX == asTriangle.iTexture) { + aaiFaces[asTriangle.iTexture].push_back( 0 ); + } else if (asTriangle.iTexture >= aszTextures.size()) { ASSIMP_LOG_INFO("[SMD/VTA] Material index overflow in face"); - aaiFaces[(*iFace).iTexture].push_back((unsigned int)aszTextures.size()-1); + aaiFaces[asTriangle.iTexture].push_back((unsigned int)aszTextures.size()-1); } else { - aaiFaces[(*iFace).iTexture].push_back(iNum); + aaiFaces[asTriangle.iTexture].push_back(iNum); } ++iNum; }