mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge pull request #104182 from Ivorforce/small-little-string-function
Add missing `String + char *` function, to avoid unnecessary right side allocation to `String`.
This commit is contained in:
@@ -365,6 +365,24 @@ String String::operator+(const String &p_str) const {
|
||||
return res;
|
||||
}
|
||||
|
||||
String String::operator+(const char *p_str) const {
|
||||
String res = *this;
|
||||
res += p_str;
|
||||
return res;
|
||||
}
|
||||
|
||||
String String::operator+(const wchar_t *p_str) const {
|
||||
String res = *this;
|
||||
res += p_str;
|
||||
return res;
|
||||
}
|
||||
|
||||
String String::operator+(const char32_t *p_str) const {
|
||||
String res = *this;
|
||||
res += p_str;
|
||||
return res;
|
||||
}
|
||||
|
||||
String String::operator+(char32_t p_char) const {
|
||||
String res = *this;
|
||||
res += p_char;
|
||||
|
||||
Reference in New Issue
Block a user