Ignore:
Timestamp:
2016-06-02T02:22:40+02:00 (8 years ago)
Author:
Don-vip
Message:

findbugs, code optimization/cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r10212 r10315  
    218218        protected int getNumDataLayers() {
    219219            if (!Main.isDisplayingMapView()) return 0;
    220             int count = 0;
    221             Collection<Layer> layers = Main.map.mapView.getAllLayers();
    222             for (Layer layer : layers) {
    223                 if (layer instanceof OsmDataLayer) {
    224                     count++;
    225                 }
    226             }
    227             return count;
     220            return Utils.filteredCollection(Main.map.mapView.getAllLayers(), OsmDataLayer.class).size();
    228221        }
    229222
Note: See TracChangeset for help on using the changeset viewer.