this is just semantically wrong. as append_buffer.set_offset() was
called, so append_buffer._off is always 0. in other words,
append_buffer.length() == append_buffer.end(). using append_buffer.
length() is better in here.
Signed-off-by: Yankun Li <lioveni99@gmail.com>
if (gap > len) gap = len;
//cout << "append first char is " << data[0] << ", last char is " << data[len-1] << std::endl;
append_buffer.append(data, gap);
- append(append_buffer, append_buffer.end() - gap, gap); // add segment to the list
+ append(append_buffer, append_buffer.length() - gap, gap); // add segment to the list
len -= gap;
data += gap;
}