added more DRY compareBy function and helper class

This commit is contained in:
James Strachan
2012-09-14 12:44:09 +01:00
parent 51122a288d
commit 9c3d1071cd
3 changed files with 18 additions and 26 deletions
@@ -115,7 +115,7 @@ class KDocConfig() {
private class LongestFirstStringComparator() : Comparator<String> {
public override fun compare(s1: String?, s2: String?): Int {
return compareBy(s1, s2, { (s: String) -> s.length() }, { (s: String) -> s })
return compareBy(s1, s2, { length() }, { this })
}
public override fun equals(obj : Any?) : Boolean {