mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-25 04:22:50 +00:00
LibLocale: Propagate OOM from CLDR DateTime Vector and String operations
This commit is contained in:
parent
89da8de4ca
commit
340434ce09
Notes:
sideshowbarker
2024-07-17 00:39:13 +09:00
Author: https://github.com/trflynn89
Commit: 340434ce09
Pull-request: https://github.com/SerenityOS/serenity/pull/17290
Reviewed-by: https://github.com/linusg ✅
3 changed files with 19 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2022, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -2047,11 +2047,11 @@ static Optional<Calendar> keyword_to_calendar(KeywordCalendar keyword)
|
|||
}
|
||||
}
|
||||
|
||||
Vector<HourCycle> get_regional_hour_cycles(StringView region)
|
||||
ErrorOr<Vector<HourCycle>> get_regional_hour_cycles(StringView region)
|
||||
{
|
||||
auto region_value = hour_cycle_region_from_string(region);
|
||||
if (!region_value.has_value())
|
||||
return {};
|
||||
return Vector<HourCycle> {};
|
||||
|
||||
auto region_index = to_underlying(*region_value);
|
||||
|
||||
|
@ -2059,7 +2059,7 @@ Vector<HourCycle> get_regional_hour_cycles(StringView region)
|
|||
auto const& regional_hour_cycles = s_hour_cycle_lists.at(regional_hour_cycles_index);
|
||||
|
||||
Vector<HourCycle> hour_cycles;
|
||||
hour_cycles.ensure_capacity(regional_hour_cycles.size());
|
||||
TRY(hour_cycles.try_ensure_capacity(regional_hour_cycles.size()));
|
||||
|
||||
for (auto hour_cycle : regional_hour_cycles)
|
||||
hour_cycles.unchecked_append(static_cast<HourCycle>(hour_cycle));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue