Changeset 16041 in josm


Ignore:
Timestamp:
2020-03-06T00:23:29+01:00 (5 years ago)
Author:
simon04
Message:

see #18864 - TaggingPreset: use ArrayList with default capacity of 2

Reduces retained size of TaggingPreset from 1_893_976 to 1_758_840 (de).

Location:
trunk/src/org/openstreetmap/josm/gui/tagging/presets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r15640 r16041  
    120120     */
    121121    public transient Set<TaggingPresetType> types;
    122     public final transient List<TaggingPresetItem> data = new LinkedList<>();
     122    public final transient List<TaggingPresetItem> data = new ArrayList<>(2);
    123123    public transient Roles roles;
    124124    public transient TemplateEntry nameTemplate;
     
    641641            new ImageProvider("dialogs", "pin").getResource().attachImageIcon(this, true);
    642642            putValue(SHORT_DESCRIPTION, tr("Add or remove toolbar button"));
    643             List<String> t = new LinkedList<>(ToolbarPreferences.getToolString());
     643            List<String> t = new ArrayList<>(ToolbarPreferences.getToolString());
    644644            toolbarIndex = t.indexOf(getToolbarString());
    645645            putValue(SELECTED_KEY, toolbarIndex >= 0);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetNameTemplateList.java

    r14273 r16041  
    22package org.openstreetmap.josm.gui.tagging.presets;
    33
     4import java.util.ArrayList;
    45import java.util.Collection;
    56import java.util.EnumSet;
    6 import java.util.LinkedList;
    77import java.util.List;
    88
     
    1717    private static TaggingPresetNameTemplateList instance;
    1818
    19     private final List<TaggingPreset> presetsWithPattern = new LinkedList<>();
     19    private final List<TaggingPreset> presetsWithPattern = new ArrayList<>();
    2020
    2121    /**
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java

    r13852 r16041  
    55
    66import java.awt.GridBagLayout;
     7import java.util.ArrayList;
    78import java.util.Collection;
    8 import java.util.LinkedList;
    99import java.util.List;
    1010import java.util.Set;
     
    158158     * List of {@link Role} elements.
    159159     */
    160     public final List<Role> roles = new LinkedList<>();
     160    public final List<Role> roles = new ArrayList<>(2);
    161161
    162162    @Override
Note: See TracChangeset for help on using the changeset viewer.