Created
September 20, 2018 05:14
-
-
Save DawnImpulse/69449e4b4d017d84603f043193d99d4d to your computer and use it in GitHub Desktop.
sort custom collections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this will be a descending sort | |
fun sortLabels(labels: List<FirebaseVisionLabel>): List<FirebaseVisionLabel> { | |
Collections.sort(labels) { o1, o2 -> | |
o2.confidence.compareTo(o1.confidence) | |
} | |
return labels | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment