Everywhere: Use AK::SaturatingMath and remove Checked saturating APIs

Port all callers of Checked<T>::saturating_add/sub/mul to the new
standalone functions in AK/SaturatingMath.h, and remove the old
APIs from Checked.
This commit is contained in:
Andreas Kling
2026-03-21 08:42:32 -05:00
committed by Andreas Kling
parent 31f816a6d8
commit eb789e790e
Notes: github-actions[bot] 2026-03-21 23:21:17 +00:00
10 changed files with 37 additions and 103 deletions

View File

@@ -49,7 +49,7 @@ String CounterStyleValue::resolve(DOM::AbstractElement& element_reference) const
if (m_properties.function == CounterFunction::Counter) {
// NOTE: This should always be present because of the handling of a missing counter above.
auto& counter = counters_set.last_counter_with_name(m_properties.counter_name).value();
return generate_a_counter_representation(m_properties.counter_style->as_counter_style().resolve_counter_style(registered_counter_styles), registered_counter_styles, counter.value.value_or(0).value());
return generate_a_counter_representation(m_properties.counter_style->as_counter_style().resolve_counter_style(registered_counter_styles), registered_counter_styles, counter.value.value_or(0));
}
// counters( <counter-name>, <string>, <counter-style>? )
@@ -62,7 +62,7 @@ String CounterStyleValue::resolve(DOM::AbstractElement& element_reference) const
if (counter.name != m_properties.counter_name)
continue;
auto counter_string = generate_a_counter_representation(m_properties.counter_style->as_counter_style().resolve_counter_style(registered_counter_styles), registered_counter_styles, counter.value.value_or(0).value());
auto counter_string = generate_a_counter_representation(m_properties.counter_style->as_counter_style().resolve_counter_style(registered_counter_styles), registered_counter_styles, counter.value.value_or(0));
if (!stb.is_empty())
stb.append(m_properties.join_string);
stb.append(counter_string);