Changeset 193ad43


Ignore:
Timestamp:
Apr 17, 2016 3:29:18 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0ceb957
Parents:
4290b1e
Message:

Util: Minor optimization in OrderedProperties?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/OrderedProperties.java

    r4290b1e r193ad43  
    3838    @Override
    3939    public Set<Object> keySet() {
     40        if (size() <= 1)
     41            return super.keySet();
    4042        return Collections.unmodifiableSortedSet(new TreeSet<Object>(super.keySet()));
    4143    }
     
    4345    @Override
    4446    public Set<Map.Entry<Object, Object>> entrySet() {
     47        if (size() <= 1)
     48            return super.entrySet();
    4549        TreeSet<Map.Entry<Object, Object>> rv = new TreeSet<Map.Entry<Object, Object>>(new EntryComparator());
    4650        rv.addAll(super.entrySet());
Note: See TracChangeset for help on using the changeset viewer.