FastBinaryEncoding icon indicating copy to clipboard operation
FastBinaryEncoding copied to clipboard

The throw occurs

Open feelwa17 opened this issue 1 year ago • 0 comments

The throw occurs too frequently in the following code.

void FBEBuffer::remove(size_t offset, size_t size) { assert(((offset + size) <= _size) && "Invalid offset & size!!"); if ((offset + size) > _size) throw std::invalid_argument("Invalid offset & size!!");

std::memcpy(_data + offset, _data + offset + size, _size - size - offset);
_size -= size;
if (_offset >= (offset + size))
    _offset -= size;
else if (_offset >= offset)
{
    _offset -= _offset - offset;
    if (_offset > _size)
        _offset = _size;
}

}

After that, the transmission doesn't proceed. What is the solution?

feelwa17 avatar Sep 13 '24 08:09 feelwa17