1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-05 01:26:23 +00:00

Use Comparator.comparingDouble().

This commit is contained in:
Isira Seneviratne 2022-08-03 06:01:32 +05:30
parent 059cfcbad2
commit d1f3f15478

View File

@ -31,7 +31,7 @@ public class PreferenceFuzzySearchFunction
// Specific search - Used for determining order of search results
// Calculate a score based on specific search fields
.map(item -> new FuzzySearchSpecificDTO(item, keyword))
.sorted(Comparator.comparing(FuzzySearchSpecificDTO::getScore).reversed())
.sorted(Comparator.comparingDouble(FuzzySearchSpecificDTO::getScore).reversed())
.map(FuzzySearchSpecificDTO::getItem)
// Limit the amount of search results
.limit(20);