summaryrefslogtreecommitdiff
path: root/runtime/type_reference.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/type_reference.h')
-rw-r--r--runtime/type_reference.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/type_reference.h b/runtime/type_reference.h
index b7e964b3ad3..c44019dde35 100644
--- a/runtime/type_reference.h
+++ b/runtime/type_reference.h
@@ -37,6 +37,15 @@ struct TypeReference {
dex::TypeIndex type_index;
};
+struct TypeReferenceComparator {
+ bool operator()(TypeReference mr1, TypeReference mr2) const {
+ if (mr1.dex_file != mr2.dex_file) {
+ return mr1.dex_file < mr2.dex_file;
+ }
+ return mr1.type_index < mr2.type_index;
+ }
+};
+
// Compare the actual referenced type names. Used for type reference deduplication.
struct TypeReferenceValueComparator {
bool operator()(TypeReference tr1, TypeReference tr2) const {