mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 00:07:34 +00:00
Refactor: Expose const_cast by removing ByteBuffer::warp(const void*, size_t)
This function did a const_cast internally which made the call side look "safe". This method is removed completely and call sites are replaced with ByteBuffer::wrap(const_cast<void*>(data), size) which makes the behaviour obvious.
This commit is contained in:
parent
ac9f6fd1f8
commit
b3d1a05261
15 changed files with 42 additions and 36 deletions
|
@ -166,7 +166,7 @@ public:
|
|||
{
|
||||
if (m_size_remaining < count)
|
||||
return false;
|
||||
buffer = ByteBuffer::wrap(m_data_ptr, count);
|
||||
buffer = ByteBuffer::wrap(const_cast<u8*>(m_data_ptr), count);
|
||||
m_data_ptr += count;
|
||||
m_size_remaining -= count;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue