mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
This commit is contained in:
@@ -299,10 +299,10 @@ ThrowCompletionOr<DurationUnitOptions> get_duration_unit_options(GlobalObject& g
|
||||
// here, but at some point we should split the the NumberFormat exporter to export both formats of the data.
|
||||
static String convert_number_format_pattern_to_duration_format_template(Unicode::NumberFormat const& number_format)
|
||||
{
|
||||
auto result = number_format.zero_format.replace("{number}", "{0}");
|
||||
auto result = number_format.zero_format.replace("{number}", "{0}", ReplaceMode::FirstOnly);
|
||||
|
||||
for (size_t i = 0; i < number_format.identifiers.size(); ++i)
|
||||
result = result.replace(String::formatted("{{unitIdentifier:{}}}", i), number_format.identifiers[i]);
|
||||
result = result.replace(String::formatted("{{unitIdentifier:{}}}", i), number_format.identifiers[i], ReplaceMode::FirstOnly);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user