You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Used as a more readable equivalent to the traditional for loop operating
over a range of values, such as all elements in a container, in the
forward direction.
====
Range based loopes are more explicit for only computing the
end location once for containers.
for ( ImageIORegion::IndexType::const_iterator i = this->GetIndex().begin();
i != this->GetIndex().end(); //<- NOTE: Compute end every loop iteration
++i )
for (long i : this->GetIndex()) //<- NOTE: Implicitly only compute end once
====
Explicitly reduce the amount of index computations: (The compiler
probably does this too)
for(int i = 0; i < 11; i++)
{
pos[0] = testPoints[i][0];
pos[1] = testPoints[i][1];
^^^^
for(auto & testPoint : testPoints)
{
pos[0] = testPoint[0];
pos[1] = testPoint[1];
====
SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clangtidy/ #My local BLD
cd /Users/johnsonhj/Dashboard/src/ITK-clangtidy/
run-clang-tidy.py -checks=-*,modernize-loop-convert -header-filter=.* -fix
Change-Id: I9a6b6a73491beb61fde913e3a2cf209f7c8601e5
0 commit comments