Re: Sort on linkedlists with double values (inside main list)
"M.v.Gulik" <[email protected]>
| Newsgroups | gmane.comp.lang.groovy.user |
|---|---|
| Message-ID | <CAOSpiuGfKvUu4x-vKFroBxQCH6remVUD95nST-vv_-X9GL_Scw@mail.gmail.com> |
After fixing my local bug I rechecked the "*.sort{ a, b -> a.y == b.y ?
-a.y <=> -b.y : a.x <=> b.x }" variant.
Same result/conclusion.
However, on a hunch, I split in into two separate consecutive sorts.
"*.sort{ a, b -> a.x <=> b.x }.sort{ a, b -> -a.y <=> -b.y }"
So far this seems to do the job of fully sorting my 2d/coordinates set. (so
far: no guaranties, as the used data set is somewhat limited and specific.)