-
Notifications
You must be signed in to change notification settings - Fork 46
part3 (Kozyrev Egor) #42
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
base: master
Are you sure you want to change the base?
Conversation
throw new UnsupportedOperationException(); | ||
return inner.characteristics() | ||
| NONNULL | ||
| SIZED; |
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.
Array may be bigger than the unsized inner.
} | ||
|
||
@Override | ||
public boolean tryAdvance(Consumer<? super Pair<A, B>> action) { | ||
// TODO | ||
throw new UnsupportedOperationException(); | ||
return (currentIndex < endIndex |
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 if
to simplify this expression.
} | ||
|
||
@Override | ||
public void forEachRemaining(Consumer<? super Pair<A, B>> action) { | ||
// TODO | ||
throw new UnsupportedOperationException(); | ||
while (currentIndex < endIndex) { |
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.
Inefficient. You can optimize this in case inner.hasCharacteristics(SIZED)
.
} | ||
|
||
@Override | ||
public Spliterator<Pair<A, B>> trySplit() { | ||
// TODO | ||
throw new UnsupportedOperationException(); | ||
Spliterator<A> splitInner = this.inner.trySplit(); |
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 not SIZED
inner spliterator and parallel()
.
} | ||
|
||
@Override | ||
public long estimateSize() { | ||
// TODO | ||
throw new UnsupportedOperationException(); | ||
return endIndex - currentIndex; |
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.
No description provided.