Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

part3 (Kozyrev Egor) #42

wants to merge 1 commit into from

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.

}

@Override
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.

}

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

}

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

}

@Override
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