From f9ba2efe1e60fa919b0efe70994416149b54ee26 Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Sat, 1 Feb 2020 07:04:14 +0100 Subject: Modify Dictionary::operator== to do real key/value comparison with recursive support (and add unittests) --- core/variant/dictionary.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/variant/dictionary.h') diff --git a/core/variant/dictionary.h b/core/variant/dictionary.h index 4067ff9fd9..f8a2a7573f 100644 --- a/core/variant/dictionary.h +++ b/core/variant/dictionary.h @@ -70,8 +70,10 @@ public: bool operator==(const Dictionary &p_dictionary) const; bool operator!=(const Dictionary &p_dictionary) const; + bool recursive_equal(const Dictionary &p_dictionary, int recursion_count) const; uint32_t hash() const; + uint32_t recursive_hash(int recursion_count) const; void operator=(const Dictionary &p_dictionary); const Variant *next(const Variant *p_key = nullptr) const; @@ -80,6 +82,7 @@ public: Array values() const; Dictionary duplicate(bool p_deep = false) const; + Dictionary recursive_duplicate(bool p_deep, int recursion_count) const; const void *id() const; -- cgit v1.2.3