KBuffer: capacity() should return internal capacity, not internal size

KBuffer is just meant to be a dumb wrapper around KBufferImpl.
With this change, we actually start to see KBuffers with different size
and capacity, which allows some reallocation-avoiding optimizations.
This commit is contained in:
Andreas Kling 2019-08-24 18:31:45 +02:00
parent 11f88a78ad
commit 9bd68b189e

View file

@ -68,7 +68,7 @@ public:
u8* data() { return m_impl->data(); }
const u8* data() const { return m_impl->data(); }
size_t size() const { return m_impl->size(); }
size_t capacity() const { return m_impl->size(); }
size_t capacity() const { return m_impl->capacity(); }
void set_size(size_t size) { m_impl->set_size(size); }