From 11c4066159e12ff630673c5fd94b37fb8c0f9102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 7 Dec 2020 12:21:11 +0100 Subject: 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. --- source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc b/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc index f2ae121e8ae..e9810aed179 100644 --- a/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc +++ b/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc @@ -37,8 +37,8 @@ TEST(LockfreeLinkList, InsertMultiple) LockfreeLinkNode nodes[num_nodes]; BLI_linklist_lockfree_init(&list); /* Insert all the nodes. */ - for (int i = 0; i < num_nodes; ++i) { - BLI_linklist_lockfree_insert(&list, &nodes[i]); + for (LockfreeLinkNode &node : nodes) { + BLI_linklist_lockfree_insert(&list, &node); } /* Check head and tail. */ EXPECT_EQ(list.head, &list.dummy_node); -- cgit v1.2.3