Ignore:
Timestamp:
2015-10-10T01:40:42+02:00 (9 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib - minor performance improvements:

  • Method passes constant String of length 1 to character overridden method
  • Method needlessly boxes a boolean constant
  • Method uses iterator().next() on a List to get the first item
  • Method converts String to boxed primitive using excessive boxing
  • Method converts String to primitive using excessive boxing
  • Method creates array using constants
  • Class defines List based fields but uses them like Sets
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r8510 r8846  
    162162            String val = primitive.get(key);
    163163            IconPrototype p;
    164             if ((p = icons.get("n" + key + "=" + val)) != null) {
     164            if ((p = icons.get('n' + key + '=' + val)) != null) {
    165165                icon = update(icon, p, scale, mc);
    166166            }
    167             if ((p = icons.get("b" + key + "=" + OsmUtils.getNamedOsmBoolean(val))) != null) {
     167            if ((p = icons.get('b' + key + '=' + OsmUtils.getNamedOsmBoolean(val))) != null) {
    168168                icon = update(icon, p, scale, mc);
    169169            }
    170             if ((p = icons.get("x" + key)) != null) {
     170            if ((p = icons.get('x' + key)) != null) {
    171171                icon = update(icon, p, scale, mc);
    172172            }
     
    194194            LinePrototype styleLine;
    195195            LinemodPrototype styleLinemod;
    196             String idx = "n" + key + "=" + val;
     196            String idx = 'n' + key + '=' + val;
    197197            if ((styleArea = areas.get(idx)) != null && (closed || !styleArea.closed) && !isNotArea) {
    198198                p.area = update(p.area, styleArea, scale, mc);
     
    209209                }
    210210            }
    211             idx = "b" + key + "=" + OsmUtils.getNamedOsmBoolean(val);
     211            idx = 'b' + key + '=' + OsmUtils.getNamedOsmBoolean(val);
    212212            if ((styleArea = areas.get(idx)) != null && (closed || !styleArea.closed) && !isNotArea) {
    213213                p.area = update(p.area, styleArea, scale, mc);
     
    224224                }
    225225            }
    226             idx = "x" + key;
     226            idx = 'x' + key;
    227227            if ((styleArea = areas.get(idx)) != null && (closed || !styleArea.closed) && !isNotArea) {
    228228                p.area = update(p.area, styleArea, scale, mc);
Note: See TracChangeset for help on using the changeset viewer.