Skip to content

Commit

Permalink
fix stream (#452)
Browse files Browse the repository at this point in the history
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
  • Loading branch information
Glease authored Dec 19, 2024
1 parent 7185b20 commit 935cf26
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public boolean contains(long l) {
@NotNull
@Override
public Iterator<ChunkCoordIntPair> iterator() {
return longSet.stream().map(this::fromLongSafe).iterator();
return longSet.longStream().mapToObj(this::fromLongSafe).iterator();
}

public Iterator<ChunkCoordIntPair> unsafeIterator() {
// Reuses the same ChunkCoordIntPair object for every iteration, use this when you know the code won't
// be storing the result anywhere
return longSet.stream().map(this::fromLongUnsafe).iterator();
return longSet.longStream().mapToObj(this::fromLongUnsafe).iterator();
}

public LongIterator longIterator() {
Expand All @@ -75,7 +75,7 @@ public LongIterator longIterator() {
@NotNull
@Override
public Object[] toArray() {
return longSet.stream().map(this::fromLongSafe).toArray();
return longSet.longStream().mapToObj(this::fromLongSafe).toArray();
}

@NotNull
Expand Down

0 comments on commit 935cf26

Please sign in to comment.