Fix type-reference compare for the null/null case.

Change-Id: If43d3a7c311d6d9d2d927aa638bc1da4b5e96a14
diff --git a/src/main/java/com/android/tools/r8/utils/TypeReferenceUtils.java b/src/main/java/com/android/tools/r8/utils/TypeReferenceUtils.java
index 76e6f33..15344f9 100644
--- a/src/main/java/com/android/tools/r8/utils/TypeReferenceUtils.java
+++ b/src/main/java/com/android/tools/r8/utils/TypeReferenceUtils.java
@@ -11,6 +11,9 @@
 
   private static final Comparator<TypeReference> COMPARATOR =
       (type, other) -> {
+        if (type == other) {
+          return 0;
+        }
         // Handle null inputs (void).
         if (type == null) {
           return -1;