Il2CppGenericMethodHash.cpp 710 B

1234567891011121314151617181920212223242526
  1. #include "il2cpp-config.h"
  2. #include "il2cpp-class-internals.h"
  3. #include "Il2CppGenericMethodHash.h"
  4. #include "Il2CppGenericContextHash.h"
  5. #include "utils/HashUtils.h"
  6. using il2cpp::utils::HashUtils;
  7. namespace il2cpp
  8. {
  9. namespace metadata
  10. {
  11. size_t Il2CppGenericMethodHash::operator()(const Il2CppGenericMethod* method) const
  12. {
  13. return Hash(method);
  14. }
  15. size_t Il2CppGenericMethodHash::Hash(const Il2CppGenericMethod* method)
  16. {
  17. size_t tokenHash = method->methodDefinition->token;
  18. size_t contextHash = Il2CppGenericContextHash::Hash(&method->context);
  19. return HashUtils::Combine(tokenHash, contextHash);
  20. }
  21. } /* namespace metadata */
  22. } /* namespace il2cpp */