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/DuplicateRelation.java

    r8836 r8850  
    243243        long idToKeep = 0;
    244244        Relation relationToKeep = relFix.iterator().next();
    245         // Only one relation will be kept - the one with lowest positive ID, if such exist
    246         // or one "at random" if no such exists. Rest of the relations will be deleted
    247         for (Relation w: relFix) {
    248             if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) {
    249                 idToKeep = w.getId();
    250                 relationToKeep = w;
    251             }
    252         }
    253 
    254245        // Find the relation that is member of one or more relations. (If any)
    255246        Relation relationWithRelations = null;
     
    262253                relationWithRelations = w;
    263254                relRef = rel;
     255            }
     256            // Only one relation will be kept - the one with lowest positive ID, if such exist
     257            // or one "at random" if no such exists. Rest of the relations will be deleted
     258            if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) {
     259                idToKeep = w.getId();
     260                relationToKeep = w;
    264261            }
    265262        }
Note: See TracChangeset for help on using the changeset viewer.