Ignore:
Timestamp:
2020-05-17T12:08:17+02:00 (4 years ago)
Author:
simon04
Message:

see #19251 - Java 8: use Stream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java

    r16398 r16436  
    202202     */
    203203    public GpxExtension find(String prefix, String key) {
    204         for (GpxExtension child : this) {
    205             GpxExtension ext = child.findExtension(prefix, key);
    206             if (ext != null) {
    207                 return ext;
    208             }
    209         }
    210         return null;
     204        return this.stream()
     205                .map(child -> child.findExtension(prefix, key)).filter(Objects::nonNull)
     206                .findFirst().orElse(null);
    211207    }
    212208
Note: See TracChangeset for help on using the changeset viewer.