You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +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:
@@ -57,16 +57,16 @@ bool EditorPropertyNameProcessor::is_localization_available() {
|
||||
}
|
||||
|
||||
String EditorPropertyNameProcessor::_capitalize_name(const String &p_name) const {
|
||||
const Map<String, String>::Element *cached = capitalize_string_cache.find(p_name);
|
||||
HashMap<String, String>::ConstIterator cached = capitalize_string_cache.find(p_name);
|
||||
if (cached) {
|
||||
return cached->value();
|
||||
return cached->value;
|
||||
}
|
||||
|
||||
Vector<String> parts = p_name.split("_", false);
|
||||
for (int i = 0; i < parts.size(); i++) {
|
||||
const Map<String, String>::Element *remap = capitalize_string_remaps.find(parts[i]);
|
||||
HashMap<String, String>::ConstIterator remap = capitalize_string_remaps.find(parts[i]);
|
||||
if (remap) {
|
||||
parts.write[i] = remap->get();
|
||||
parts.write[i] = remap->value;
|
||||
} else {
|
||||
parts.write[i] = parts[i].capitalize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user