Ignore:
Timestamp:
2015-10-10T15:15:14+02:00 (9 years ago)
Author:
Don-vip
Message:

sonar - squid:S3047 - Multiple loops over the same set should be combined

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java

    r8836 r8850  
    253253        long idToKeep = 0;
    254254        Way wayToKeep = ways.iterator().next();
    255         // Only one way will be kept - the one with lowest positive ID, if such exist
    256         // or one "at random" if no such exists. Rest of the ways will be deleted
    257         for (Way w: ways) {
    258             if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) {
    259                 idToKeep = w.getId();
    260                 wayToKeep = w;
    261             }
    262         }
    263 
    264255        // Find the way that is member of one or more relations. (If any)
    265256        Way wayWithRelations = null;
     
    273264                relations = rel;
    274265            }
     266            // Only one way will be kept - the one with lowest positive ID, if such exist
     267            // or one "at random" if no such exists. Rest of the ways will be deleted
     268            if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) {
     269                idToKeep = w.getId();
     270                wayToKeep = w;
     271            }
    275272        }
    276273
Note: See TracChangeset for help on using the changeset viewer.