Skip to content

Commit

Permalink
Merge pull request #140 from nedtwigg/patch-1
Browse files Browse the repository at this point in the history
Fix `IterableForIterator` to accept `? extends T`
  • Loading branch information
jjlauer committed Nov 4, 2023
2 parents b7fe13e + 3119687 commit 9fd1ec3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
*/
public class IterableForIterator<T> implements ForIterator {

private final Iterator<T> iterator;
private final Iterator<? extends T> iterator;
private int index;

public IterableForIterator(Iterable<T> c) {
public IterableForIterator(Iterable<? extends T> c) {
this(c.iterator());
}

Expand Down Expand Up @@ -68,7 +68,7 @@ public IterableForIterator(double[] a) {
this((Iterable<T>) new PrimitiveCollections.DoubleCollection(a));
}

public IterableForIterator(Iterator<T> iterator) {
public IterableForIterator(Iterator<? extends T> iterator) {
this.iterator = iterator;
this.index = -1;
}
Expand Down

0 comments on commit 9fd1ec3

Please sign in to comment.