I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 193ad430 authored by zzz's avatar zzz
Browse files

Util: Minor optimization in OrderedProperties

parent 4290b1e7
No related branches found
No related tags found
No related merge requests found
......@@ -37,11 +37,15 @@ public class OrderedProperties extends Properties {
@Override
public Set<Object> keySet() {
if (size() <= 1)
return super.keySet();
return Collections.unmodifiableSortedSet(new TreeSet<Object>(super.keySet()));
}
@Override
public Set<Map.Entry<Object, Object>> entrySet() {
if (size() <= 1)
return super.entrySet();
TreeSet<Map.Entry<Object, Object>> rv = new TreeSet<Map.Entry<Object, Object>>(new EntryComparator());
rv.addAll(super.entrySet());
return Collections.unmodifiableSortedSet(rv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment