Usage of a function in loops should be avoided
Merge pull request #5815