-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PackedByteArray, Array slice end exclusive, rename PackedByteArray subarray to slice #35901
PackedByteArray, Array slice end exclusive, rename PackedByteArray subarray to slice #35901
Conversation
@aaronfranke I don't remember specifically why I did that in the first place, I should've written that down in the PR, but my guess is that it was because the pool byte array was already inclusive. |
528d377
to
4a8a4e8
Compare
Updated to new master branch. Should work completely fine but additional testing may be needed |
Edit: Done with this! |
4a8a4e8
to
d2fba1b
Compare
I remember why I made the array slice inclusive on both ends now, it's to make it so that when the In hindsight, it might be more clear to the user if the first index and last index were switched around when |
dfe74f0
to
66129f9
Compare
I updated this to master. I need to understand exactly what the expected behaviour should be, especially with negative steps. Examples of current behaviour: var a = [0, 1, 2, 3, 4, 5, 6, 7]
print(a.slice(0, 4)) # [0, 1, 2, 3]
print(a.slice(4, 8, -1)) # []
print(a.slice(8, 0, -1)) # [7, 6, 5, 4, 3, 2, 1, 0]
print(a.slice(-1, 0, -1)) # [6, 5, 4, 3, 2, 1, 0] |
2db1348
to
1fccef3
Compare
Rebased again. Added documentation for |
86df8b6
to
d67dc38
Compare
Requesting rebase. |
d67dc38
to
26fa515
Compare
abdec0c
to
9d2d8b2
Compare
9d2d8b2
to
dd30253
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR meeting: makes sense, approved :)
Thanks! |
See #56661 for a follow-up discussion on the behavior for negative |
slice
end index is now exclusivePacked*Array::subarray
is nowPacked*Array::slice