1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:57:44 +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

@ -25,7 +25,7 @@ Bitmap const* Emoji::emoji_for_code_point(u32 code_point)
return emoji_for_code_points(Array { code_point });
}
Bitmap const* Emoji::emoji_for_code_points(Span<u32 const> const& code_points)
Bitmap const* Emoji::emoji_for_code_points(ReadonlySpan<u32> const& code_points)
{
// FIXME: This function is definitely not fast.
auto basename = DeprecatedString::join('_', code_points, "U+{:X}"sv);

View file

@ -17,7 +17,7 @@ class Bitmap;
class Emoji {
public:
static Gfx::Bitmap const* emoji_for_code_point(u32 code_point);
static Gfx::Bitmap const* emoji_for_code_points(Span<u32 const> const&);
static Gfx::Bitmap const* emoji_for_code_points(ReadonlySpan<u32> const&);
static Gfx::Bitmap const* emoji_for_code_point_iterator(Utf8CodePointIterator&);
};

View file

@ -274,7 +274,7 @@ Optional<i16> Kern::read_glyph_kerning_format0(ReadonlyBytes slice, u16 left_gly
return {};
// FIXME: implement a possibly slightly more efficient binary search using the parameters above
Span<Format0Pair const> pairs { bit_cast<Format0Pair const*>(slice.slice(sizeof(Format0)).data()), number_of_pairs };
ReadonlySpan<Format0Pair> pairs { bit_cast<Format0Pair const*>(slice.slice(sizeof(Format0)).data()), number_of_pairs };
// The left and right halves of the kerning pair make an unsigned 32-bit number, which is then used to order the kerning pairs numerically.
auto needle = (static_cast<u32>(left_glyph_id) << 16u) | static_cast<u32>(right_glyph_id);