summaryrefslogtreecommitdiff
path: root/core/dictionary.cpp
diff options
context:
space:
mode:
authorsantiagopf <punto@Ariels-Mac-mini.local>2015-12-14 10:58:26 -0300
committersantiagopf <punto@Ariels-Mac-mini.local>2015-12-14 10:58:26 -0300
commita9795d582665598decd4e73e1d879c83ce28a44b (patch)
tree777a3da33fed3d6906704680e01bd87f97eba113 /core/dictionary.cpp
parentc8077de71475c174aa14fd045a2cddfc28de2468 (diff)
parentbfaa179e7088d9d6f4cf289e1915eec12c6b3b2a (diff)
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'core/dictionary.cpp')
-rw-r--r--core/dictionary.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp
index b2d31f230d..c544573629 100644
--- a/core/dictionary.cpp
+++ b/core/dictionary.cpp
@@ -160,7 +160,20 @@ void Dictionary::_unref() const {
}
uint32_t Dictionary::hash() const {
- return hash_djb2_one_64(make_uint64_t(_p));
+ uint32_t h=hash_djb2_one_32(Variant::DICTIONARY);
+
+ List<Variant> keys;
+ get_key_list(&keys);
+
+ for (List<Variant>::Element *E=keys.front();E;E=E->next()) {
+
+ h = hash_djb2_one_32( E->get().hash(), h);
+ h = hash_djb2_one_32( operator[](E->get()).hash(), h);
+
+ }
+
+
+ return h;
}
Array Dictionary::keys() const {