You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Rewrite HashMapHasherDefault based on type traits - it is now possible to declare a default hashing function for any type.
Remove cross-project includes from `hashfuncs.h`. Improve hashing function for `Color` (based on values instead of `String`). Move `Variant` comparison from `hash_map.h` to `dictionary.cpp` (`VariantComparatorDictionary`), where it's used. Remove now unnecessary `HashableHasher`.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "core/string/char_utils.h" // IWYU pragma: export
|
||||
#include "core/templates/cowdata.h"
|
||||
#include "core/templates/hashfuncs.h"
|
||||
#include "core/templates/vector.h"
|
||||
#include "core/typedefs.h"
|
||||
#include "core/variant/array.h"
|
||||
@@ -232,6 +233,8 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
uint32_t hash() const { return hash_djb2(get_data()); }
|
||||
|
||||
protected:
|
||||
void copy_from(const T *p_cstr) {
|
||||
if (!p_cstr) {
|
||||
|
||||
Reference in New Issue
Block a user