Changeset 1494 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-03-17T18:52:31+01:00 (15 years ago)
Author:
stoecker
Message:

fix #2312 - performance optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r1444 r1494  
    142142          private OsmPrimitive current;
    143143          private String generator;
     144          private Map<String, String> keys = new HashMap<String, String>();
    144145//          int n = 0;
    145146
     
    257258                    } else if (qName.equals("tag")) {
    258259//                         tagsN++;
    259                          current.put(atts.getValue("k"), atts.getValue("v"));
     260                        String key = atts.getValue("k");
     261                        String internedKey = keys.get(key);
     262                        if (internedKey == null) {
     263                            internedKey = key;
     264                            keys.put(key, key);
     265                        }
     266                         current.put(internedKey, atts.getValue("v"));
    260267                    }
    261268               } catch (NumberFormatException x) {
Note: See TracChangeset for help on using the changeset viewer.