Index: src/core/SkPtrRecorder.cpp |
diff --git a/src/core/SkPtrRecorder.cpp b/src/core/SkPtrRecorder.cpp |
index d473cab8c1bf5fd0c006cca9a00a4fe6bdcbacb8..2acb5af9398b2c38e155d17cb6627be07da61b6f 100644 |
--- a/src/core/SkPtrRecorder.cpp |
+++ b/src/core/SkPtrRecorder.cpp |
@@ -21,8 +21,8 @@ void SkPtrSet::reset() { |
fList.reset(); |
} |
-int SkPtrSet::Cmp(const Pair* a, const Pair* b) { |
- return (char*)a->fPtr - (char*)b->fPtr; |
+bool SkPtrSet::Less(const Pair& a, const Pair& b) { |
+ return (char*)a.fPtr < (char*)b.fPtr; |
} |
uint32_t SkPtrSet::find(void* ptr) const { |
@@ -34,7 +34,7 @@ uint32_t SkPtrSet::find(void* ptr) const { |
Pair pair; |
pair.fPtr = ptr; |
- int index = SkTSearch<Pair, Cmp>(fList.begin(), count, pair, sizeof(pair)); |
+ int index = SkTSearch<Pair, Less>(fList.begin(), count, pair, sizeof(pair)); |
if (index < 0) { |
return 0; |
} |
@@ -50,7 +50,7 @@ uint32_t SkPtrSet::add(void* ptr) { |
Pair pair; |
pair.fPtr = ptr; |
- int index = SkTSearch<Pair, Cmp>(fList.begin(), count, pair, sizeof(pair)); |
+ int index = SkTSearch<Pair, Less>(fList.begin(), count, pair, sizeof(pair)); |
if (index < 0) { |
index = ~index; // turn it back into an index for insertion |
this->incPtr(ptr); |