Skip to content

Conversation

egor-ka
Copy link

@egor-ka egor-ka commented Apr 14, 2017

No description provided.

throw new UnsupportedOperationException();
return inner.characteristics()
| NONNULL
| SIZED;

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.

public boolean tryAdvance(Consumer<? super Pair<A, B>> action) {
// TODO
throw new UnsupportedOperationException();
return (currentIndex < endIndex

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.

public void forEachRemaining(Consumer<? super Pair<A, B>> action) {
// TODO
throw new UnsupportedOperationException();
while (currentIndex < endIndex) {

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).

public Spliterator<Pair<A, B>> trySplit() {
// TODO
throw new UnsupportedOperationException();
Spliterator<A> splitInner = this.inner.trySplit();

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().

public long estimateSize() {
// TODO
throw new UnsupportedOperationException();
return endIndex - currentIndex;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants