1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:17:45 +00:00

Everywhere: Use ReadonlySpan<T> instead of Span<T const>

This commit is contained in:
MacDue 2023-02-05 19:02:54 +00:00 committed by Linus Groh
parent 1c92e6ee9d
commit 63b11030f0
102 changed files with 206 additions and 206 deletions

View file

@ -786,14 +786,14 @@ StringView style_to_string(Style style)
}
}
Span<StringView const> __attribute__((weak)) get_available_keyword_values(StringView) { return {}; }
Span<StringView const> __attribute__((weak)) get_available_calendars() { return {}; }
Span<StringView const> __attribute__((weak)) get_available_collation_case_orderings() { return {}; }
Span<StringView const> __attribute__((weak)) get_available_collation_numeric_orderings() { return {}; }
Span<StringView const> __attribute__((weak)) get_available_collation_types() { return {}; }
Span<StringView const> __attribute__((weak)) get_available_currencies() { return {}; }
Span<StringView const> __attribute__((weak)) get_available_hour_cycles() { return {}; }
Span<StringView const> __attribute__((weak)) get_available_number_systems() { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_keyword_values(StringView) { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_calendars() { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_collation_case_orderings() { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_collation_numeric_orderings() { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_collation_types() { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_currencies() { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_hour_cycles() { return {}; }
ReadonlySpan<StringView> __attribute__((weak)) get_available_number_systems() { return {}; }
Optional<Locale> __attribute__((weak)) locale_from_string(StringView) { return {}; }
Optional<Language> __attribute__((weak)) language_from_string(StringView) { return {}; }
Optional<Territory> __attribute__((weak)) territory_from_string(StringView) { return {}; }

View file

@ -146,14 +146,14 @@ ErrorOr<Optional<String>> canonicalize_unicode_locale_id(LocaleID&);
StringView default_locale();
bool is_locale_available(StringView locale);
Span<StringView const> get_available_keyword_values(StringView key);
Span<StringView const> get_available_calendars();
Span<StringView const> get_available_collation_case_orderings();
Span<StringView const> get_available_collation_numeric_orderings();
Span<StringView const> get_available_collation_types();
Span<StringView const> get_available_currencies();
Span<StringView const> get_available_hour_cycles();
Span<StringView const> get_available_number_systems();
ReadonlySpan<StringView> get_available_keyword_values(StringView key);
ReadonlySpan<StringView> get_available_calendars();
ReadonlySpan<StringView> get_available_collation_case_orderings();
ReadonlySpan<StringView> get_available_collation_numeric_orderings();
ReadonlySpan<StringView> get_available_collation_types();
ReadonlySpan<StringView> get_available_currencies();
ReadonlySpan<StringView> get_available_hour_cycles();
ReadonlySpan<StringView> get_available_number_systems();
Style style_from_string(StringView style);
StringView style_to_string(Style style);

View file

@ -22,7 +22,7 @@ ErrorOr<Optional<NumberFormat>> __attribute__((weak)) get_standard_number_system
ErrorOr<Vector<NumberFormat>> __attribute__((weak)) get_compact_number_system_formats(StringView, StringView, CompactNumberFormatType) { return Vector<NumberFormat> {}; }
ErrorOr<Vector<NumberFormat>> __attribute__((weak)) get_unit_formats(StringView, StringView, Style) { return Vector<NumberFormat> {}; }
Optional<Span<u32 const>> __attribute__((weak)) get_digits_for_number_system(StringView)
Optional<ReadonlySpan<u32>> __attribute__((weak)) get_digits_for_number_system(StringView)
{
// Fall back to "latn" digits when Unicode data generation is disabled.
constexpr Array<u32, 10> digits { { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 } };

View file

@ -64,7 +64,7 @@ enum class NumericSymbol : u8 {
ErrorOr<Optional<StringView>> get_number_system_symbol(StringView locale, StringView system, NumericSymbol symbol);
ErrorOr<Optional<NumberGroupings>> get_number_system_groupings(StringView locale, StringView system);
Optional<Span<u32 const>> get_digits_for_number_system(StringView system);
Optional<ReadonlySpan<u32>> get_digits_for_number_system(StringView system);
ErrorOr<String> replace_digits_for_number_system(StringView system, StringView number);
ErrorOr<Optional<NumberFormat>> get_standard_number_system_format(StringView locale, StringView system, StandardNumberFormatType type);

View file

@ -34,7 +34,7 @@ PluralCategory __attribute__((weak)) determine_plural_category(StringView, Plura
return PluralCategory::Other;
}
Span<PluralCategory const> __attribute__((weak)) available_plural_categories(StringView, PluralForm)
ReadonlySpan<PluralCategory> __attribute__((weak)) available_plural_categories(StringView, PluralForm)
{
static constexpr Array<PluralCategory, 1> categories { { PluralCategory::Other } };
return categories.span();

View file

@ -118,7 +118,7 @@ constexpr StringView plural_category_to_string(PluralCategory category)
}
PluralCategory determine_plural_category(StringView locale, PluralForm form, PluralOperands operands);
Span<PluralCategory const> available_plural_categories(StringView locale, PluralForm form);
ReadonlySpan<PluralCategory> available_plural_categories(StringView locale, PluralForm form);
PluralCategory determine_plural_range(StringView locale, PluralCategory start, PluralCategory end);
}