Fixing other missing cases of truncated sorts.

Bug: 24505761
Change-Id: I9b9358e8b134f0c4aac32ac536d9c8a1f0629957
This commit is contained in:
Winson
2015-09-29 16:58:02 -07:00
parent c088049113
commit 46a06da01c
2 changed files with 3 additions and 3 deletions

View File

@@ -252,8 +252,8 @@ public class InvariantDeviceProfile {
ArrayList<InvariantDeviceProfile> pointsByNearness = points;
Collections.sort(pointsByNearness, new Comparator<InvariantDeviceProfile>() {
public int compare(InvariantDeviceProfile a, InvariantDeviceProfile b) {
return (int) (dist(width, height, a.minWidthDps, a.minHeightDps)
- dist(width, height, b.minWidthDps, b.minHeightDps));
return Float.compare(dist(width, height, a.minWidthDps, a.minHeightDps),
dist(width, height, b.minWidthDps, b.minHeightDps));
}
});