summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-26 18:17:03 +0200
committerGitHub <noreply@github.com>2022-07-26 18:17:03 +0200
commit835da447dabb552a5d558b40d2df3c3c426f3498 (patch)
tree7728150cdcebaa93d21ef92a7818717280ddfea9 /core
parentb5222c07846b4742425a001121d998fe92050c20 (diff)
parent9679c67904b4714e3f3166fbc7174347f1038bc4 (diff)
Merge pull request #63481 from m4gr3d/fix_remaining_scoped_storage_regressions_main
Address remaining scoped storage regressions
Diffstat (limited to 'core')
-rw-r--r--core/core_bind.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index 26ecd41353..cb57cd7057 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -1220,16 +1220,10 @@ Vector<uint8_t> File::get_buffer(int64_t p_length) const {
String File::get_as_text() const {
ERR_FAIL_COND_V_MSG(f.is_null(), String(), "File must be opened before use, or is lacking read-write permission.");
- String text;
uint64_t original_pos = f->get_position();
const_cast<FileAccess *>(*f)->seek(0);
- String l = get_line();
- while (!eof_reached()) {
- text += l + "\n";
- l = get_line();
- }
- text += l;
+ String text = f->get_as_utf8_string();
const_cast<FileAccess *>(*f)->seek(original_pos);