Skip to content

Commit 3fccb86

Browse files
author
Jeff Brown
committed
Make LTE_FLOAT a strict weak order. (DO NOT MERGE)
Bug: 5327776 Currently LTE_FLOAT isn't even a valid partial order, let alone a strict weak order as needed by binary search. Consequently, KeyedVectors with keys whose types have operator< using LTE_FLOAT sometimes find the wrong values! This problem affects several graphics caches including the TextLayoutCache. (This is still not a total order because NaNs are not comparable but hopefully we don't ever search for NaNs this way!) Change-Id: Ic447a34c7d87f681ee81538f22a0937a039072dd
1 parent 3d5759b commit 3fccb86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/hwui/utils/Compare.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
#define LTE_FLOAT(a) \
3030
if (a < rhs.a) return true; \
31-
if (ALMOST_EQUAL(a, rhs.a))
31+
if (a == rhs.a)
3232

3333
/**
3434
* Compare integers.

0 commit comments

Comments
 (0)