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
Fix ArrayBufferView
, ArrayOps.ArrayIterator
and View.Patched
#9388
Fix ArrayBufferView
, ArrayOps.ArrayIterator
and View.Patched
#9388
Conversation
0380a60
to
2b7fd10
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2b7fd10
to
4d3783f
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.
Thank you so much @NthPortal! (for your patience also…!)
59759a8
to
55f4b15
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
LGTM, again leaving to @SethTisue |
6538cc8
to
01ce8db
Compare
This comment has been minimized.
This comment has been minimized.
@NthPortal hard to be totally sure, but afaict the |
@SethTisue yes.
edit: we need to benchmark |
2nd attempt to attract reviewer attention from @scala/collections crew and/or @julienrf |
Hey, sorry I can’t review the PR soon. |
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.
maybe I suffer from anxiety, but given this is in the standard library, and given that we already have found bugs, I think we need more extensive tests. I've suggested two scalachecks to add.
20ea0c0
to
8d00b29
Compare
@NthPortal what's next here? are you interested in doing the ScalaCheck thing @johnynek suggested? |
@SethTisue i've been and continue to be sick, but i'll try to add the scalacheck stuff today or tomorrow. if i don't get to it, and @johnynek has perms, they can feel free to add a commit to this branch with it |
8d00b29
to
ace976c
Compare
oops I've bumped into ANOTHER unreported bug (by way of testing the fix for the first unreported bug too, not just separately as part of working on the main bug) |
ArrayBufferView
, View.Patched
and ArrayOps.ArrayIterator
ArrayBufferView
, View.Patched
and ArrayOps.ArrayIterator
ArrayBufferView
, ArrayOps.ArrayIterator
and View.Patched
f7b43ca
to
5a378ea
Compare
this is done as far as I'm concerned |
@johnynek how do you feel about the tests now? |
Ensure `ArrayBufferView` is consistent with its buffer. Simplify `ArrayBuffer#insertAll` code.
Fix unreported bug in `ArrayOps.ArrayIterator` where index in array can overflow to negative, and in such cases the iterator reports `hasNext` incorrectly as `true`. Improve code documentation and readability of `Iterator.patch` implementation, which was bumped into while investigating the bug. Discovered while writing tests for bug in `View.Patched` (see following commit).
3ac3159
to
1f950f4
Compare
Fix unreported bug in `View.Patched` where iterator is incorrect due to the patch only being iterable once, and already having been exhausted. Discovered while attempting to optimise `ArrayBuffer` in an earlier version of the previous commit.
1f950f4
to
8853372
Compare
Ensure
ArrayBufferView
is consistent with its buffer.Simplify
ArrayBuffer#insertAll
code.Fix unreported bug in
ArrayOps.ArrayIterator
whereindex in array can overflow to negative, and in such cases
the iterator reports
hasNext
incorrectly astrue
.Improve code documentation and readability of
Iterator.patch
implementation, which was bumpedinto while investigating the bug.
Discovered while writing tests for bug in
View.Patched
(see below).
Fix unreported bug in
View.Patched
where iteratoris incorrect due to the patch only being iterable once,
and already having been exhausted.
Discovered while attempting to optimise
ArrayBuffer
alongsidefixing
ArrayBufferView
(eventually scrapped).Fixes scala/bug#12284