From 7ceeb745354e246ec91cbdcd6f17c8291c09aec0 Mon Sep 17 00:00:00 2001 From: DexesTTP Date: Tue, 5 Jul 2022 22:33:15 +0200 Subject: 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. --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibWeb/CSS') diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 615ffd43b4..ca41f9317c 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -2883,7 +2883,7 @@ Optional Parser::parse_unicode_range(StringView text) // 2. Interpret the consumed code points as a hexadecimal number, // with the U+003F QUESTION MARK (?) code points replaced by U+0030 DIGIT ZERO (0) code points. // This is the start value. - auto start_value_string = start_value_code_points.replace("?", "0", true); + auto start_value_string = start_value_code_points.replace("?", "0", ReplaceMode::All); auto maybe_start_value = AK::StringUtils::convert_to_uint_from_hex(start_value_string); if (!maybe_start_value.has_value()) { dbgln_if(CSS_PARSER_DEBUG, "CSSParser: ?-converted start value did not parse as hex number."); @@ -2894,7 +2894,7 @@ Optional Parser::parse_unicode_range(StringView text) // 3. Interpret the consumed code points as a hexadecimal number again, // with the U+003F QUESTION MARK (?) code points replaced by U+0046 LATIN CAPITAL LETTER F (F) code points. // This is the end value. - auto end_value_string = start_value_code_points.replace("?", "F", true); + auto end_value_string = start_value_code_points.replace("?", "F", ReplaceMode::All); auto maybe_end_value = AK::StringUtils::convert_to_uint_from_hex(end_value_string); if (!maybe_end_value.has_value()) { dbgln_if(CSS_PARSER_DEBUG, "CSSParser: ?-converted end value did not parse as hex number."); -- cgit v1.2.3