Il2CppGenericInstHash.cpp 680 B

123456789101112131415161718192021222324252627
  1. #include "il2cpp-config.h"
  2. #include "il2cpp-class-internals.h"
  3. #include "Il2CppGenericInstHash.h"
  4. #include "Il2CppTypeHash.h"
  5. #include "utils/HashUtils.h"
  6. using il2cpp::utils::HashUtils;
  7. namespace il2cpp
  8. {
  9. namespace metadata
  10. {
  11. size_t Il2CppGenericInstHash::operator()(const Il2CppGenericInst* item) const
  12. {
  13. return Hash(item);
  14. }
  15. size_t Il2CppGenericInstHash::Hash(const Il2CppGenericInst* item)
  16. {
  17. size_t hash = item->type_argc;
  18. for (size_t i = 0; i < item->type_argc; ++i)
  19. hash = HashUtils::Combine(hash, Il2CppTypeHash::Hash(item->type_argv[i]));
  20. return hash;
  21. }
  22. } /* namespace vm */
  23. } /* namespace il2cpp */