You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user