Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.5.1
-
None
Description
The implementation of DefaultGroovyMethods.plus(Map,Map) uses a TreeMap, but the javadoc says HashMap.
I think a HashMap should be used here. I think that performs better.
In the odd case that someone wants to add two maps and have a sorted map as the result, it should be implemented explicitly, like
result = new TreeMap( map1 )
result.putAll( map2 )
or with the (still missing) leftShift operator
result = new TreeMap( map1 ) << map2
So, +1 for the leftshift operator (GROOVY-644)
I think I'll try to write a patch for this.
Attachments
Issue Links
- is related to
-
GROOVY-2388 Applying the plus operator to a SortedSet yields a HashSet
- Closed