Port away from foreach in d807b017
missed that the loop body adds further collections to the map,
as interesting for later code, but not this one.
Doing an explicit copy instead now.
No related bug known, so far code path changing map only seen in
unit tests.