-
Notifications
You must be signed in to change notification settings - Fork 46
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
Aleksandra Pankratova #44
base: master
Are you sure you want to change the base?
Conversation
// TODO | ||
throw new UnsupportedOperationException(); | ||
inner.forEachRemaining((Double d) -> { | ||
action.accept(new IndexedDoublePair(currentIndex, d)); |
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.
Incorrect. Add test with collect(toList())
.
} | ||
|
||
@Override | ||
public int characteristics() { | ||
// TODO | ||
throw new UnsupportedOperationException(); | ||
return inner.characteristics(); |
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.
Incorrect. See documentation for SORTED
.
} | ||
|
||
@Override | ||
public void forEachRemaining(Consumer<? super Pair<A, B>> action) { | ||
// TODO | ||
throw new UnsupportedOperationException(); | ||
inner.forEachRemaining(a -> { |
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.
Incorrect. Add test with array shorter than spliterator.
Spliterator<A> split = inner.trySplit(); | ||
if (split == null) return null; | ||
final ZipWithArraySpliterator<A, B> spliterator = new ZipWithArraySpliterator<>(split, array); | ||
spliterator.setIndex(index); |
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.
Use constructor parameter.
if (split == null) return null; | ||
final ZipWithArraySpliterator<A, B> spliterator = new ZipWithArraySpliterator<>(split, array); | ||
spliterator.setIndex(index); | ||
index = Math.min((int) (index + split.estimateSize()), array.length); |
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.
Unnecessary. index + split.estimateSize()
works just fine.
No description provided.