Slice arguments for computed only once. Fixes #4847
Merge pull request #4849 from mixonic/double-slice

Slice arguments for computed only once. Fixes #4847