Add String::replace_char(s) methods for performance and convenience

This commit is contained in:
A Thousand Ships 2024-05-28 12:15:00 +02:00
parent c374ce211c
commit 889410dcda
No known key found for this signature in database
GPG key ID: DEFC5A5B1306947D
67 changed files with 297 additions and 137 deletions

View file

@ -1867,7 +1867,7 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
return false;
}
f = f.substr(6);
f = f.replace("\\", "/");
f = f.replace_char('\\', '/');
Vector<String> path = f.split("/");
@ -1993,7 +1993,7 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p
}
f = f.substr(6);
f = f.replace("\\", "/");
f = f.replace_char('\\', '/');
if (f.is_empty()) {
return filesystem;
}