summaryrefslogtreecommitdiff
path: root/scene/main/node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r--scene/main/node.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 0d646ff2a9..87f77ed4bd 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -892,7 +892,7 @@ void Node::_set_name_nocheck(const StringName &p_name) {
void Node::set_name(const String &p_name) {
String name = p_name.validate_node_name();
- ERR_FAIL_COND(name == "");
+ ERR_FAIL_COND(name.is_empty());
data.name = name;
if (data.parent) {
@@ -1990,7 +1990,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const
nip->set_instance_path(ip->get_instance_path());
node = nip;
- } else if ((p_flags & DUPLICATE_USE_INSTANCING) && get_scene_file_path() != String()) {
+ } else if ((p_flags & DUPLICATE_USE_INSTANCING) && !get_scene_file_path().is_empty()) {
Ref<PackedScene> res = ResourceLoader::load(get_scene_file_path());
ERR_FAIL_COND_V(res.is_null(), nullptr);
PackedScene::GenEditState ges = PackedScene::GEN_EDIT_STATE_DISABLED;
@@ -2014,7 +2014,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const
ERR_FAIL_COND_V(!node, nullptr);
}
- if (get_scene_file_path() != "") { //an instance
+ if (!get_scene_file_path().is_empty()) { //an instance
node->set_scene_file_path(get_scene_file_path());
node->data.editable_instance = data.editable_instance;
}
@@ -2046,7 +2046,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const
node_tree.push_back(descendant);
- if (descendant->get_scene_file_path() != "" && instance_roots.has(descendant->get_owner())) {
+ if (!descendant->get_scene_file_path().is_empty() && instance_roots.has(descendant->get_owner())) {
instance_roots.push_back(descendant);
}
}