diff --git a/Userland/Libraries/LibUnicode/Locale.h b/Userland/Libraries/LibUnicode/Locale.h index 3192052996..0a388fd16e 100644 --- a/Userland/Libraries/LibUnicode/Locale.h +++ b/Userland/Libraries/LibUnicode/Locale.h @@ -58,14 +58,19 @@ struct LocaleID { String to_string() const; template - void remove_extension_type() + Vector remove_extension_type() { + Vector removed_extensions {}; auto tmp_extensions = move(extensions); for (auto& extension : tmp_extensions) { - if (!extension.has()) + if (extension.has()) + removed_extensions.append(move(extension)); + else extensions.append(move(extension)); } + + return removed_extensions; } LanguageID language_id {};