Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
It would be nice to be able to reverse the order of a map without running collect on it first. For example,
def foo = ["string1":1, "string2":2, "string3":3]
println foo.sort
//println foo.sort {it.value}
.reverse() // <-- this is what I propose
This is, of course, a simplistic example for which there are workarounds, like
foo.sort {-it.value}
but I could imagine other potential uses for this method.
Attachments
Issue Links
- is related to
-
GROOVY-2597 Map or Property Sort
- Closed