1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

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

This commit is contained in:
A Thousand Ships
2024-05-28 12:55:07 +02:00
parent cae3d722a3
commit 331a43a9d8
35 changed files with 221 additions and 54 deletions

View File

@@ -336,7 +336,7 @@ Ref<DirAccess> DirAccess::create_temp(const String &p_prefix, bool p_keep, Error
uint32_t suffix_i = 0;
String path;
while (true) {
String datetime = Time::get_singleton()->get_datetime_string_from_system().replace("-", "").replace("T", "").replace(":", "");
String datetime = Time::get_singleton()->get_datetime_string_from_system().remove_chars("-T:");
datetime += itos(Time::get_singleton()->get_ticks_usec());
String suffix = datetime + (suffix_i > 0 ? itos(suffix_i) : "");
path = (p_prefix.is_empty() ? "" : p_prefix + "-") + suffix;