Fix repeated iterator generation
### Motivation
Fix repeated iterator generation
@@ -276,7 +276,7 @@ public interface LongPairRangeSet<T extends Comparable<T>> {
public Range<T> firstRange() {
Iterator<Range<T>> iterable = set.asRanges().iterator();
if (iterable.hasNext()) {
- return set.asRanges().iterator().next();
+ return iterable.next();
}
return null;
}
