You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Address remaining scoped storage regressions
- Accelerate common path used to check the storage scope for a given path - Update the logic for the `get_as_text()` method - previous logic loads the content of a text file one byte at a time
This commit is contained in:
@@ -2091,16 +2091,10 @@ PoolVector<uint8_t> _File::get_buffer(int64_t p_length) const {
|
||||
String _File::get_as_text() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, String(), "File must be opened before use.");
|
||||
|
||||
String text;
|
||||
uint64_t original_pos = f->get_position();
|
||||
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();
|
||||
|
||||
f->seek(original_pos);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user