summaryrefslogtreecommitdiff
path: root/core/ustring.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-09-04 13:00:17 +0200
committerGitHub <noreply@github.com>2020-09-04 13:00:17 +0200
commit696849f73a9bebc95cecf25256ae7011c912dae3 (patch)
tree6bd8d8cb872a4600804c31ec281f734cd5f46a77 /core/ustring.h
parent6a03aed5a4c6dcc2b645b90ce15ba33bf17819d2 (diff)
parentce263c4ff680f28594ffc1886a4f418c50c41ef7 (diff)
Merge pull request #41761 from madmiraal/fix-assignment-operators
Ensure assignment operators return by reference to avoid unnecessary copies.
Diffstat (limited to 'core/ustring.h')
-rw-r--r--core/ustring.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/ustring.h b/core/ustring.h
index 65eeae6643..1f8a5d7e7d 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -103,7 +103,7 @@ public:
_FORCE_INLINE_ Char16String() {}
_FORCE_INLINE_ Char16String(const Char16String &p_str) { _cowdata._ref(p_str._cowdata); }
- _FORCE_INLINE_ Char16String operator=(const Char16String &p_str) {
+ _FORCE_INLINE_ Char16String &operator=(const Char16String &p_str) {
_cowdata._ref(p_str._cowdata);
return *this;
}
@@ -147,7 +147,7 @@ public:
_FORCE_INLINE_ CharString() {}
_FORCE_INLINE_ CharString(const CharString &p_str) { _cowdata._ref(p_str._cowdata); }
- _FORCE_INLINE_ CharString operator=(const CharString &p_str) {
+ _FORCE_INLINE_ CharString &operator=(const CharString &p_str) {
_cowdata._ref(p_str._cowdata);
return *this;
}
@@ -435,7 +435,7 @@ public:
_FORCE_INLINE_ String() {}
_FORCE_INLINE_ String(const String &p_str) { _cowdata._ref(p_str._cowdata); }
- String operator=(const String &p_str) {
+ String &operator=(const String &p_str) {
_cowdata._ref(p_str._cowdata);
return *this;
}