1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:37:35 +00:00

Kernel: Add KBuffer::bytes() and use it

(Instead of hand-wrapping { data(), size() } in a bunch of places.)
This commit is contained in:
Andreas Kling 2021-09-08 18:29:52 +02:00
parent bee2de4b31
commit 524ef5e475
7 changed files with 9 additions and 7 deletions

View file

@ -42,6 +42,9 @@ public:
[[nodiscard]] size_t size() const { return m_size; }
[[nodiscard]] size_t capacity() const { return m_region->size(); }
[[nodiscard]] ReadonlyBytes bytes() const { return { data(), size() }; }
[[nodiscard]] Bytes bytes() { return { data(), size() }; }
void set_size(size_t size)
{
VERIFY(size <= capacity());