Avoid second loop.