Ignore:
Timestamp:
2020-02-22T19:40:23+01:00 (6 years ago)
Author:
simon04
Message:

see #18749 - Intern strings to reduce memory footprint of svgSalamander

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/kitfox/svg/SVGElement.java

    r14643 r15901  
    260260        if (this.id != null && !this.id.equals(""))
    261261        {
     262            this.id = this.id.intern();
    262263            diagram.setElement(this.id, this);
    263264        }
    264265
    265266        String className = attrs.getValue("class");
    266         this.cssClass = (className == null || className.equals("")) ? null : className;
     267        this.cssClass = (className == null || className.equals("")) ? null : className.intern();
    267268        //docRoot = helper.docRoot;
    268269        //universe = helper.universe;
     
    298299            String value = attrs.getValue(i);
    299300
    300             presAttribs.put(name, new StyleAttribute(name, value));
     301            presAttribs.put(name, new StyleAttribute(name, value == null ? null : value.intern()));
    301302        }
    302303    }
Note: See TracChangeset for help on using the changeset viewer.