Limit object copying when looping over containers.