Avoid modifying container we're iterating over.