diff options
author | Joan Fons <joan.fonssanchez@gmail.com> | 2021-07-19 19:25:15 +0200 |
---|---|---|
committer | Joan Fons <joan.fonssanchez@gmail.com> | 2021-07-20 20:35:41 +0200 |
commit | a6adb584934a885adf6ca775f2ef7118b66f684e (patch) | |
tree | ff32816397839c53f5cbe65a852210d63fd5693c /core/string | |
parent | b1eee24e2673b4a980a6f661511ff0f18c2fff8a (diff) |
Editor StringName and Viewport optimizations
* Added explicit return type to the SNAME macro.
* Add some extra SNAME usages.
* Change some ClassDB methods to use const StringName & arguments.
* Cache the Window parent in Control because it's used in
is_layout_rtl(), which is called often.
* Only enable internal processing for viewports that need it.
* Change CanvasItem::group to be a StringName because it's only used as
that.
Diffstat (limited to 'core/string')
-rw-r--r-- | core/string/string_name.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/string/string_name.h b/core/string/string_name.h index ead321c5b0..f5e7ff509d 100644 --- a/core/string/string_name.h +++ b/core/string/string_name.h @@ -167,6 +167,6 @@ bool operator!=(const char *p_name, const StringName &p_string_name); StringName _scs_create(const char *p_chr, bool p_static = false); -#define SNAME(m_arg) ([]() { static StringName sname = _scs_create(m_arg, true); return sname; })() +#define SNAME(m_arg) ([]() -> const StringName & { static StringName sname = _scs_create(m_arg, true); return sname; })() #endif // STRING_NAME_H |