Skip to content
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

Implement subList() on primitive immutable lists #1155

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

Implement subList() on primitive immutable lists #1155

wants to merge 1 commit into from

Conversation

sneznaj
Copy link

@sneznaj sneznaj commented Nov 16, 2021

part of #1053

@@ -532,7 +532,7 @@ public ImmutableLongList distinct()
@Override
public ImmutableLongList subList(int fromIndex, int toIndex)
{
throw new UnsupportedOperationException("subList not yet implemented!");
return new LongIntervalSubList<>(this, fromIndex, toIndex);
Copy link
Member

Choose a reason for hiding this comment

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

This can be replaced with just (another) LongInterval, so there is no need for the inner class.

@sneznaj
Copy link
Author

sneznaj commented Nov 23, 2021

new try #1160

{
newItems.set(this.size);
}
return new ImmutableBooleanArrayList(newItems, this.size + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look like it uses the from offset.

@donraab donraab changed the title mplement subList() on primitive immutable lists Implement subList() on primitive immutable lists Apr 25, 2022
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.

None yet

3 participants