Ignore:
Timestamp:
2019-03-25T09:03:56+01:00 (6 years ago)
Author:
gerdp
Message:

sonarlint: combine this loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java

    r34922 r34944  
    179179        }
    180180        // first handle those relations which don't refer to other relations
     181        List<Relation> withRelationsMembers = new ArrayList<>();
    181182        for (Relation relation: sourceDataSet.getRelations()) {
    182183            if (relation.getMemberPrimitives(Relation.class).isEmpty()) {
    183184                mergeRelation(relation);
    184             }
    185         }
    186         // now the rest of the relations.
    187         for (Relation relation: sourceDataSet.getRelations()) {
    188             if (!relation.getMemberPrimitives(Relation.class).isEmpty()) {
    189                 mergeRelation(relation);
    190             }
    191         }
     185            } else {
     186                // postpone
     187                withRelationsMembers.add(relation);
     188            }
     189        }
     190        withRelationsMembers.forEach(this::mergeRelation);
    192191    }
    193192
Note: See TracChangeset for help on using the changeset viewer.