You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
This commit is contained in:
@@ -64,7 +64,7 @@ void EditorQuickOpen::_build_search_cache(EditorFileSystemDirectory *p_efsd) {
|
||||
// Store refs to used icons.
|
||||
String ext = file.get_extension();
|
||||
if (!icons.has(ext)) {
|
||||
icons.insert(ext, get_theme_icon((has_theme_icon(file_type, "EditorIcons") ? file_type : "Object"), "EditorIcons"));
|
||||
icons.insert(ext, get_theme_icon((has_theme_icon(file_type, SNAME("EditorIcons")) ? file_type : String("Object")), SNAME("EditorIcons")));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void EditorQuickOpen::_confirmed() {
|
||||
return;
|
||||
}
|
||||
_cleanup();
|
||||
emit_signal("quick_open");
|
||||
emit_signal(SNAME("quick_open"));
|
||||
hide();
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ void EditorQuickOpen::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void EditorQuickOpen::_theme_changed() {
|
||||
search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons"));
|
||||
search_box->set_right_icon(search_options->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void EditorQuickOpen::_bind_methods() {
|
||||
|
||||
Reference in New Issue
Block a user