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/gpu/intern/gpu_shader.cc
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/gpu/intern/gpu_shader.cc')
-rw-r--r--source/blender/gpu/intern/gpu_shader.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc
index 827ea06686f..d47ad5e0100 100644
--- a/source/blender/gpu/intern/gpu_shader.cc
+++ b/source/blender/gpu/intern/gpu_shader.cc
@@ -470,9 +470,9 @@ struct GPUShader *GPU_shader_create_from_arrays_impl(
GPUShader *sh = GPU_shader_create(
str_dst[0].str, str_dst[1].str, str_dst[2].str, nullptr, str_dst[3].str, name);
- for (int i = 0; i < ARRAY_SIZE(str_dst); i++) {
- if (str_dst[i].is_alloc) {
- MEM_freeN((void *)str_dst[i].str);
+ for (auto &i : str_dst) {
+ if (i.is_alloc) {
+ MEM_freeN((void *)i.str);
}
}
return sh;