mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
AK: Make ByteBuffer::slice(0, size()) a freebie
If you want the whole buffer, we can just give you the buffer itself.
This commit is contained in:
parent
3a5a9a683f
commit
64cb04996f
Notes:
sideshowbarker
2024-07-18 21:20:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/64cb04996f3
1 changed files with 3 additions and 0 deletions
|
@ -214,6 +214,9 @@ public:
|
|||
if (is_null())
|
||||
return {};
|
||||
|
||||
if (offset == 0 && size == this->size())
|
||||
return *this;
|
||||
|
||||
// I cannot hand you a slice I don't have
|
||||
VERIFY(offset + size <= this->size());
|
||||
|
||||
|
|
Loading…
Reference in a new issue