Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-12-07 14:21:11 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-12-07 14:41:17 +0300
commit11c4066159e12ff630673c5fd94b37fb8c0f9102 (patch)
tree79c365fe59bf852478c561c1a7fd1679831a2be7 /source/blender/io/collada/collada_utils.cpp
parent2072134faadf4fd901c88ed7440e2289d61e0299 (diff)
Cleanup: partial Clang-Tidy modernize-loop-convert
Modernize loops by using the `for(type variable : container)` syntax. Some loops were trivial to fix, whereas others required more attention to avoid semantic changes. I couldn't address all old-style loops, so this commit doesn't enable the `modernize-loop-convert` rule. Although Clang-Tidy's auto-fixer prefers to use `auto` for the loop variable declaration, I made as many declarations as possible explicit. To me this increases local readability, as you don't need to fully understand the container in order to understand the loop variable type. No functional changes.
Diffstat (limited to 'source/blender/io/collada/collada_utils.cpp')
-rw-r--r--source/blender/io/collada/collada_utils.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/io/collada/collada_utils.cpp b/source/blender/io/collada/collada_utils.cpp
index c57952afcc8..25c10c717e2 100644
--- a/source/blender/io/collada/collada_utils.cpp
+++ b/source/blender/io/collada/collada_utils.cpp
@@ -379,11 +379,9 @@ void bc_match_scale(std::vector<Object *> *objects_done,
UnitConverter &bc_unit,
bool scale_to_scene)
{
- for (std::vector<Object *>::iterator it = objects_done->begin(); it != objects_done->end();
- ++it) {
- Object *ob = *it;
+ for (Object *ob : *objects_done) {
if (ob->parent == nullptr) {
- bc_match_scale(*it, bc_unit, scale_to_scene);
+ bc_match_scale(ob, bc_unit, scale_to_scene);
}
}
}
@@ -524,10 +522,8 @@ BoneExtensionManager::~BoneExtensionManager()
std::map<std::string, BoneExtensionMap *>::iterator map_it;
for (map_it = extended_bone_maps.begin(); map_it != extended_bone_maps.end(); ++map_it) {
BoneExtensionMap *extended_bones = map_it->second;
- for (BoneExtensionMap::iterator ext_it = extended_bones->begin();
- ext_it != extended_bones->end();
- ++ext_it) {
- delete ext_it->second;
+ for (auto &extended_bone : *extended_bones) {
+ delete extended_bone.second;
}
extended_bones->clear();
delete extended_bones;