Add GLOBAL_GET cached macros.
GLOBAL_GET is an expensive operation which should not be used each frame / tick. This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed. Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
@ -590,7 +590,7 @@ void ScriptTextEditor::_validate_script() {
|
||||
warnings_panel->clear();
|
||||
|
||||
// Add missing connections.
|
||||
if (GLOBAL_GET("debug/gdscript/warnings/enable").booleanize()) {
|
||||
if (GLOBAL_GET_CACHED(bool, "debug/gdscript/warnings/enable")) {
|
||||
Node *base = get_tree()->get_edited_scene_root();
|
||||
if (base && missing_connections.size() > 0) {
|
||||
warnings_panel->push_table(1);
|
||||
|
||||
Reference in New Issue
Block a user