From: YankunLi Date: Thu, 1 Dec 2016 06:12:03 +0000 (+0800) Subject: bufferlist: cleanup semantical wrong for bufferlist::append X-Git-Tag: v12.0.0~178^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e1066e62a97c98de1d01ddba6decd73b155400f;p=ceph-ci.git bufferlist: cleanup semantical wrong for bufferlist::append 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 --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index dce326dadce..fa2f5a20aa9 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1791,7 +1791,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; 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; }