mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
Net: use KBuffer::capacity() when checking if we can reuse buffer
This commit is contained in:
committed by
Andreas Kling
parent
69a30f95cc
commit
477e13f6c5
@@ -185,7 +185,7 @@ void NetworkAdapter::did_receive(ReadonlyBytes payload)
|
||||
} else {
|
||||
buffer = m_unused_packet_buffers.take_first();
|
||||
--m_unused_packet_buffers_count;
|
||||
if (payload.size() <= buffer.value().size()) {
|
||||
if (payload.size() <= buffer.value().capacity()) {
|
||||
memcpy(buffer.value().data(), payload.data(), payload.size());
|
||||
buffer.value().set_size(payload.size());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user