Avoid copying ids in reduce_ids
We copy the ids just because the assert may consume the iterable before we convert to integer. We could avoid this copy by doing the assert during the conversion loop.
We copy the ids just because the assert may consume the iterable before we convert to integer. We could avoid this copy by doing the assert during the conversion loop.