Ignore:
Timestamp:
2020-02-26T01:52:17+01:00 (5 years ago)
Author:
simon04
Message:

see #18749 - Intern strings to reduce memory footprint

Location:
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java

    r15671 r15934  
    259259         */
    260260        public SimpleKeyValueCondition(String k, String v) {
    261             this.k = k;
    262             this.v = v;
     261            this.k = k.intern();
     262            this.v = v.intern();
    263263        }
    264264
     
    311311         */
    312312        public KeyValueCondition(String k, String v, Op op, boolean considerValAsKey) {
    313             this.k = k;
    314             this.v = v;
     313            this.k = k.intern();
     314            this.v = v.intern();
    315315            this.op = op;
    316316            this.considerValAsKey = considerValAsKey;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/LiteralExpression.java

    r14484 r15934  
    2020    public LiteralExpression(Object literal) {
    2121        CheckParameterUtil.ensureParameterNotNull(literal);
    22         this.literal = literal;
     22        this.literal = literal instanceof String ? ((String) literal).intern() : literal;
    2323    }
    2424
Note: See TracChangeset for help on using the changeset viewer.