From 3eb9b8e91bb94385cc00c0b8e6271e680dcd640f Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Sun, 22 May 2016 00:37:10 +0300 Subject: [PATCH] NFF: Use C++11 range-based for loop --- code/NFFLoader.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/code/NFFLoader.cpp b/code/NFFLoader.cpp index a3286b779..09536acdb 100644 --- a/code/NFFLoader.cpp +++ b/code/NFFLoader.cpp @@ -673,12 +673,11 @@ void NFFImporter::InternReadFile( const std::string& pFile, if ('t' == line[0]) { currentMeshWithUVCoords = NULL; - for (std::vector::iterator it = meshesWithUVCoords.begin(), end = meshesWithUVCoords.end(); - it != end;++it) + for (auto &mesh : meshesWithUVCoords) { - if ((*it).shader == s) + if (mesh.shader == s) { - currentMeshWithUVCoords = &(*it); + currentMeshWithUVCoords = &mesh; break; } } @@ -695,12 +694,11 @@ void NFFImporter::InternReadFile( const std::string& pFile, else if ('p' == line[1]) { currentMeshWithNormals = NULL; - for (std::vector::iterator it = meshesWithNormals.begin(), end = meshesWithNormals.end(); - it != end;++it) + for (auto &mesh : meshesWithNormals) { - if ((*it).shader == s) + if (mesh.shader == s) { - currentMeshWithNormals = &(*it); + currentMeshWithNormals = &mesh; break; } } @@ -717,12 +715,11 @@ void NFFImporter::InternReadFile( const std::string& pFile, else { currentMesh = NULL; - for (std::vector::iterator it = meshes.begin(), end = meshes.end(); - it != end;++it) + for (auto &mesh : meshes) { - if ((*it).shader == s) + if (mesh.shader == s) { - currentMesh = &(*it); + currentMesh = &mesh; break; } }