Changeset 5143 in josm for trunk/src


Ignore:
Timestamp:
2012-03-31T17:04:08+02:00 (12 years ago)
Author:
xeen
Message:

fix #7504 -- Remove superfluous check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r5077 r5143  
    114114
    115115            for (OsmPrimitive osm : objects) {
    116                 boolean modified = false;
    117 
    118                  // loop over all tags
     116                // loop over all tags
    119117                for (Map.Entry<String, String> tag : this.tags.entrySet()) {
    120118                    String oldVal = osm.get(tag.getKey());
     
    122120
    123121                    if (newVal == null || newVal.isEmpty()) {
    124                         if (oldVal != null) {
     122                        if (oldVal != null)
    125123                            osm.remove(tag.getKey());
    126                             modified = true;
    127                         }
    128124                    }
    129125                    else if (oldVal == null || !newVal.equals(oldVal))
    130126                        osm.put(tag.getKey(), newVal);
    131                         modified = true;
    132                 }
    133                 if (modified)
    134                     osm.setModified(true);
     127                }
     128                // init() only keeps modified primitives. Therefore the modified
     129                // bit can be set without further checks.
     130                osm.setModified(true);
    135131            }
    136132            return true;
Note: See TracChangeset for help on using the changeset viewer.