From 154049ce1792a6e12b990e0a414a6c084c3b91c5 Mon Sep 17 00:00:00 2001 From: rune-scape Date: Thu, 28 Dec 2023 14:44:23 -0800 Subject: StringName Dictionary keys also added 'is_string()' method to Variant and refactored many String type comparisons to use it instead --- modules/regex/regex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/regex/regex.cpp') diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index 85c0b9ecad..9c366408a0 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -54,8 +54,8 @@ int RegExMatch::_find(const Variant &p_name) const { return -1; } return i; - } else if (p_name.get_type() == Variant::STRING || p_name.get_type() == Variant::STRING_NAME) { - HashMap::ConstIterator found = names.find((String)p_name); + } else if (p_name.is_string()) { + HashMap::ConstIterator found = names.find(p_name); if (found) { return found->value; } -- cgit v1.2.3