1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Replace size() == 0 with is_empty().

This commit is contained in:
Yufeng Ying
2025-03-20 00:07:31 +08:00
parent c7ea8614d7
commit 4f4031a675
147 changed files with 300 additions and 300 deletions

View File

@@ -350,7 +350,7 @@ void NodePath::simplify() {
data->path.remove_at(i - 1);
data->path.remove_at(i - 1);
i -= 2;
if (data->path.size() == 0) {
if (data->path.is_empty()) {
data->path.push_back(".");
break;
}
@@ -366,7 +366,7 @@ NodePath NodePath::simplified() const {
}
NodePath::NodePath(const Vector<StringName> &p_path, bool p_absolute) {
if (p_path.size() == 0 && !p_absolute) {
if (p_path.is_empty() && !p_absolute) {
return;
}
@@ -378,7 +378,7 @@ NodePath::NodePath(const Vector<StringName> &p_path, bool p_absolute) {
}
NodePath::NodePath(const Vector<StringName> &p_path, const Vector<StringName> &p_subpath, bool p_absolute) {
if (p_path.size() == 0 && p_subpath.size() == 0 && !p_absolute) {
if (p_path.is_empty() && p_subpath.is_empty() && !p_absolute) {
return;
}