Ignore:
Timestamp:
2016-09-21T21:37:13+02:00 (8 years ago)
Author:
simon04
Message:

Use Relation.getMemberPrimitivesList where possible to avoid unnecessary set creation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTransferData.java

    r10868 r11038  
    1919import org.openstreetmap.josm.data.osm.Way;
    2020import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     21import org.openstreetmap.josm.tools.CompositeList;
    2122
    2223/**
     
    4041                return ((Way) primitive).getNodes();
    4142            } else if (primitive instanceof Relation) {
    42                 return ((Relation) primitive).getMemberPrimitives();
     43                return ((Relation) primitive).getMemberPrimitivesList();
    4344            } else {
    4445                return Collections.emptyList();
     
    102103     */
    103104    public Collection<PrimitiveData> getAll() {
    104         ArrayList<PrimitiveData> list = new ArrayList<>();
    105         list.addAll(direct);
    106         list.addAll(referenced);
    107         return list;
     105        return new CompositeList<>(direct, referenced);
    108106    }
    109107
Note: See TracChangeset for help on using the changeset viewer.