[2.2] Remove iterator from itereateUntilConverged

Profiling indicates that a minor tweak in iterateUntilConverged leads to (minor) speed up of compiling.
Merge pull request #3278 from pontusmelke/more-profiling-changes

[2.2] Remove iterator from iterateUntilConverged