Skip to content

The throw occurs #103

@feelwa17

Description

@feelwa17

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions