mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
LibJS+LibUnicode: Supply field type in CalendarPattern's for-each method
Some callers will want different behavior depending on what field is being provided to the callback.
This commit is contained in:
parent
80ea6e664d
commit
6ace4000bf
Notes:
sideshowbarker
2024-07-17 23:05:27 +09:00
Author: https://github.com/trflynn89
Commit: 6ace4000bf
Pull-request: https://github.com/SerenityOS/serenity/pull/11184
3 changed files with 32 additions and 18 deletions
|
@ -499,11 +499,11 @@ static void generate_missing_patterns(Calendar& calendar, Vector<CalendarPattern
|
|||
format.pattern12_index = replace_pattern(format.pattern_index, time_format.pattern12_index, date_format.pattern_index);
|
||||
format.pattern_index = replace_pattern(format.pattern_index, time_format.pattern_index, date_format.pattern_index);
|
||||
|
||||
format.for_each_calendar_field_zipped_with(date_format, [](auto& field, auto const& date_field) {
|
||||
format.for_each_calendar_field_zipped_with(date_format, [](auto& field, auto const& date_field, auto) {
|
||||
if (date_field.has_value())
|
||||
field = date_field;
|
||||
});
|
||||
format.for_each_calendar_field_zipped_with(time_format, [](auto& field, auto const& time_field) {
|
||||
format.for_each_calendar_field_zipped_with(time_format, [](auto& field, auto const& time_field, auto) {
|
||||
if (time_field.has_value())
|
||||
field = time_field;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue