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

Improve usage of String.split() vs get_slice()

This commit is contained in:
kobewi
2023-09-27 22:37:24 +02:00
parent 2753d333f6
commit d61a337a70
17 changed files with 45 additions and 50 deletions

View File

@@ -602,7 +602,7 @@ Vector<String> OS_Android::get_system_font_path_for_text(const String &p_font_na
font_name = font_aliases[font_name];
}
String root = String(getenv("ANDROID_ROOT")).path_join("fonts");
String lang_prefix = p_locale.split("_")[0];
String lang_prefix = p_locale.get_slicec('_', 0);
Vector<String> ret;
int best_score = 0;
for (const List<FontInfo>::Element *E = fonts.front(); E; E = E->next()) {