diff options
Diffstat (limited to 'modules/regex')
-rw-r--r-- | modules/regex/regex.cpp | 8 | ||||
-rw-r--r-- | modules/regex/regex.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index ee1137b71f..bbe92139e0 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -52,9 +52,9 @@ int RegExMatch::_find(const Variant &p_name) const { return i; } else if (p_name.get_type() == Variant::STRING) { - const Map<String, int>::Element *found = names.find((String)p_name); + HashMap<String, int>::ConstIterator found = names.find((String)p_name); if (found) { - return found->value(); + return found->value; } } @@ -75,8 +75,8 @@ int RegExMatch::get_group_count() const { Dictionary RegExMatch::get_names() const { Dictionary result; - for (const Map<String, int>::Element *i = names.front(); i != nullptr; i = i->next()) { - result[i->key()] = i->value(); + for (const KeyValue<String, int> &E : names) { + result[E.key] = E.value; } return result; diff --git a/modules/regex/regex.h b/modules/regex/regex.h index e7221f4070..1455188670 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -33,7 +33,7 @@ #include "core/object/ref_counted.h" #include "core/string/ustring.h" -#include "core/templates/map.h" +#include "core/templates/rb_map.h" #include "core/templates/vector.h" #include "core/variant/array.h" #include "core/variant/dictionary.h" @@ -48,7 +48,7 @@ class RegExMatch : public RefCounted { String subject; Vector<Range> data; - Map<String, int> names; + HashMap<String, int> names; friend class RegEx; |