mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
AK: Rename span() to bytes() when appropriate.
I originally defined the bytes() method for the String class, because it made it obvious that it's a span of bytes instead of span of characters. This commit makes this more consistent by defining a bytes() method when the type of the span is known to be u8. Additionaly, the cast operator to Bytes is overloaded for ByteBuffer and such.
This commit is contained in:
parent
525d51bbb5
commit
fff581cd72
18 changed files with 51 additions and 45 deletions
|
@ -243,6 +243,9 @@ public:
|
|||
return !(*this == other);
|
||||
}
|
||||
|
||||
operator Span<T>() { return span(); }
|
||||
operator Span<const T>() const { return span(); }
|
||||
|
||||
bool contains_slow(const T& value) const
|
||||
{
|
||||
for (size_t i = 0; i < size(); ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue