Il2CppGenericClassHash.cpp 728 B

123456789101112131415161718192021222324252627
  1. #include "il2cpp-config.h"
  2. #include "il2cpp-class-internals.h"
  3. #include "Il2CppGenericClassHash.h"
  4. #include "Il2CppGenericContextHash.h"
  5. #include "Il2CppTypeHash.h"
  6. #include "utils/HashUtils.h"
  7. using il2cpp::utils::HashUtils;
  8. namespace il2cpp
  9. {
  10. namespace metadata
  11. {
  12. size_t Il2CppGenericClassHash::operator()(const Il2CppGenericClass* item) const
  13. {
  14. return Hash(item);
  15. }
  16. size_t Il2CppGenericClassHash::Hash(const Il2CppGenericClass* item)
  17. {
  18. size_t containerHash = Il2CppTypeHash::Hash(item->type);
  19. size_t contextHash = Il2CppGenericContextHash::Hash(&item->context);
  20. return HashUtils::Combine(containerHash, contextHash);
  21. }
  22. } /* namespace vm */
  23. } /* namespace il2cpp */