Support both semantic (by default) and numeric Variant hash comparison

Hash comparison for Variant continues to perform semantic/logical comparison with NaN's considered equal by default (to prevent #16114, #7354, #6947, #8081), but now optionally allows for numeric comparison that does not consider NaN's equal to support proper value comparison (for #72222)
This commit is contained in:
Arman Elgudzhyan
2023-03-07 19:13:00 -08:00
parent 549fcce5f8
commit ee27254602
4 changed files with 10 additions and 6 deletions

View File

@ -210,7 +210,7 @@ bool Dictionary::recursive_equal(const Dictionary &p_dictionary, int recursion_c
recursion_count++;
for (const KeyValue<Variant, Variant> &this_E : _p->variant_map) {
HashMap<Variant, Variant, VariantHasher, StringLikeVariantComparator>::ConstIterator other_E(p_dictionary._p->variant_map.find(this_E.key));
if (!other_E || !this_E.value.hash_compare(other_E->value, recursion_count)) {
if (!other_E || !this_E.value.hash_compare(other_E->value, recursion_count, false)) {
return false;
}
}