Noticed some instances of slice() being called with the length property of the array that was being sliced instead of the more concise syntax using negative indices.
Details
Details
N/A, but checked to make sure slice() functions the same with the negative index and when called with its positive counterpart (...length - 1, for example).
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
This makes sense to me, I tend to use negative indices liberally when I'm writing python or whatever.
Kind of a style thing so tagging @ashoat to see if he cares/has any thoughts
Comment Actions
Makes sense. Also wanted to note that slice(0, -1) is what's used in the rest of the codebase, i.e., this change updates the only usages of slice() that don't already use the negative index syntax.