A little cleanup of `Collection#set`.

* Remove variable with only one reference.
* Consistent loops.
* Use `#slice` instead of clone when guaranteed array.