Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Il2CppGenericInstCompare.cpp 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "il2cpp-config.h"
  2. #include "il2cpp-class-internals.h"
  3. #include "Il2CppGenericInstCompare.h"
  4. #include "Il2CppTypeCompare.h"
  5. namespace il2cpp
  6. {
  7. namespace metadata
  8. {
  9. bool Il2CppGenericInstCompare::operator()(const KeyWrapper<const Il2CppGenericInst*>& t1, const KeyWrapper<const Il2CppGenericInst*>& t2) const
  10. {
  11. return Compare(t1, t2);
  12. }
  13. bool Il2CppGenericInstCompare::Compare(const KeyWrapper<const Il2CppGenericInst*>& t1, const KeyWrapper<const Il2CppGenericInst*>& t2)
  14. {
  15. if (t1.type != t2.type)
  16. return false;
  17. else if (!t1.isNormal())
  18. return true;
  19. return AreEqual(t1.key, t2.key);
  20. }
  21. bool Il2CppGenericInstCompare::AreEqual(const Il2CppGenericInst* t1, const Il2CppGenericInst* t2)
  22. {
  23. if (t1->type_argc != t2->type_argc)
  24. return false;
  25. for (size_t i = 0; i < t1->type_argc; ++i)
  26. {
  27. if (!Il2CppTypeEqualityComparer::AreEqual(t1->type_argv[i], t2->type_argv[i]))
  28. return false;
  29. }
  30. return true;
  31. }
  32. } /* namespace vm */
  33. } /* namespace il2cpp */