Thanks for review, Albert & Vlad.
BTW; still one foreach left in macOS branch of code, which I could not test-drive, so did not change (also touching internals that I could not quickly understand if there is a chance to conflicting container changes in the call chains from the loop).
(Gah, phab ate this comment before, rewriting)
@zzag Actually, while you commented on that one loop only, the same would be valid also for other loops touched in the patch. So, do you want const ref with all of them? As you can see by the existing code, it also already used values, not const ref, surely also for the reasons I gave. So, how much do you prefer const ref just for reading patterns? Shall I change also all the orher places? Or is there a chance you can be won for value types in for loops where of runtime advantage? :)
I tend to leave only one comment about troubling issue/problem and expect that the author of a patch will address all other occurrences of the issue/problem.
However, let's get this change in. Perhaps I'm too picky about const refs.