mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Resizing small doesn't reallocate the buffer.
This commit is contained in:
@@ -96,9 +96,13 @@ void Bytes::adjustBounds(unsigned pos)
|
||||
|
||||
Bytes& Bytes::resize(unsigned size)
|
||||
{
|
||||
checkWritable();
|
||||
unsigned oldsize = _high - _low;
|
||||
if (size > oldsize)
|
||||
{
|
||||
checkWritable();
|
||||
_data->resize(_low + size);
|
||||
}
|
||||
_high = _low + size;
|
||||
_data->resize(_high);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user