You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #104556 from Ivorforce/string-extend-instead-of-parse
Use `append_` instead of `parse_` for `String` methods.
This commit is contained in:
@@ -1677,7 +1677,7 @@ String EditorExportPlatformAndroid::_parse_string(const uint8_t *p_bytes, bool p
|
||||
}
|
||||
str8.write[len] = 0;
|
||||
String str;
|
||||
str.parse_utf8((const char *)str8.ptr(), len);
|
||||
str.append_utf8((const char *)str8.ptr(), len);
|
||||
return str;
|
||||
} else {
|
||||
String str;
|
||||
|
||||
@@ -203,7 +203,7 @@ String FileAccessFilesystemJAndroid::get_line() const {
|
||||
if (elem == '\n' || elem == '\0') {
|
||||
// Found the end of the line
|
||||
const_cast<FileAccessFilesystemJAndroid *>(this)->seek(start_position + line_buffer_position + 1);
|
||||
if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
|
||||
if (result.append_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
|
||||
return String();
|
||||
}
|
||||
return result;
|
||||
@@ -211,7 +211,7 @@ String FileAccessFilesystemJAndroid::get_line() const {
|
||||
}
|
||||
}
|
||||
|
||||
if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
|
||||
if (result.append_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
|
||||
return String();
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -90,7 +90,7 @@ static inline String jstring_to_string(jstring source, JNIEnv *env = nullptr) {
|
||||
}
|
||||
const char *const source_utf8 = env->GetStringUTFChars(source, nullptr);
|
||||
if (source_utf8) {
|
||||
result.parse_utf8(source_utf8);
|
||||
result.append_utf8(source_utf8);
|
||||
env->ReleaseStringUTFChars(source, source_utf8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user