summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-06-09 18:35:23 +0900
committerSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-06-09 18:35:23 +0900
commit12571a1e954247ae9611a287f03bac83ba6120da (patch)
tree0630be61f0cafa7c4c7ebdae39ac6ac81de6733b /core
parent5833f597865c773fae3ee09fc4e31d4a243f812d (diff)
downloadredot-engine-12571a1e954247ae9611a287f03bac83ba6120da.tar.gz
Match the coding style for concatenating String
Diffstat (limited to 'core')
-rw-r--r--core/string/node_path.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/string/node_path.cpp b/core/string/node_path.cpp
index 8ae2efb787..fdc72bc8dc 100644
--- a/core/string/node_path.cpp
+++ b/core/string/node_path.cpp
@@ -215,7 +215,10 @@ StringName NodePath::get_concatenated_names() const {
String concatenated;
const StringName *sn = data->path.ptr();
for (int i = 0; i < pc; i++) {
- concatenated += i == 0 ? sn[i].operator String() : "/" + sn[i];
+ if (i > 0) {
+ concatenated += "/";
+ }
+ concatenated += sn[i].operator String();
}
data->concatenated_path = concatenated;
}
@@ -230,7 +233,10 @@ StringName NodePath::get_concatenated_subnames() const {
String concatenated;
const StringName *ssn = data->subpath.ptr();
for (int i = 0; i < spc; i++) {
- concatenated += i == 0 ? ssn[i].operator String() : ":" + ssn[i];
+ if (i > 0) {
+ concatenated += ":";
+ }
+ concatenated += ssn[i].operator String();
}
data->concatenated_subpath = concatenated;
}