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