Changeset 16061 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-03-07T23:45:20+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java
r13919 r16061 7 7 import java.util.NoSuchElementException; 8 8 import java.util.Objects; 9 import java.util.Spliterator; 10 import java.util.Spliterators; 9 11 import java.util.function.Predicate; 10 12 … … 87 89 88 90 @Override 91 public Spliterator<T> spliterator() { 92 return Spliterators.spliteratorUnknownSize(iterator(), 0); 93 } 94 95 @Override 89 96 public int size() { 90 97 if (size == -1) { 91 98 size = 0; 92 Iterator<T> it = iterator(); 93 while (it.hasNext()) { 94 size++; 95 it.next(); 96 } 99 forEach(t -> size++); 97 100 } 98 101 return size;
Note:
See TracChangeset
for help on using the changeset viewer.