From 522d4243bfd2fcb5de7597e7829ad3b99df68244 Mon Sep 17 00:00:00 2001 From: Yuri Rubinsky Date: Tue, 20 Dec 2022 17:22:44 +0300 Subject: [PATCH] Add missing != operator to `StringName` --- core/string/string_name.cpp | 4 ++++ core/string/string_name.h | 1 + editor/plugins/visual_shader_editor_plugin.cpp | 2 +- servers/rendering/shader_language.cpp | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/string/string_name.cpp b/core/string/string_name.cpp index 9c4fc4e1b7a..64d49b8b937 100644 --- a/core/string/string_name.cpp +++ b/core/string/string_name.cpp @@ -169,6 +169,10 @@ bool StringName::operator!=(const String &p_name) const { return !(operator==(p_name)); } +bool StringName::operator!=(const char *p_name) const { + return !(operator==(p_name)); +} + bool StringName::operator!=(const StringName &p_name) const { // the real magic of all this mess happens here. // this is why path comparisons are very fast diff --git a/core/string/string_name.h b/core/string/string_name.h index ff4c41af940..6a2420e02af 100644 --- a/core/string/string_name.h +++ b/core/string/string_name.h @@ -102,6 +102,7 @@ public: bool operator==(const String &p_name) const; bool operator==(const char *p_name) const; bool operator!=(const String &p_name) const; + bool operator!=(const char *p_name) const; _FORCE_INLINE_ bool is_node_unique_name() const { if (!_data) { diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index cf811067c94..c93b0019dcb 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1263,7 +1263,7 @@ Dictionary VisualShaderEditor::get_custom_node_data(Ref void VisualShaderEditor::update_custom_type(const Ref &p_resource) { Ref