From: Sage Weil Date: Wed, 16 Apr 2008 16:34:33 +0000 (-0700) Subject: buffer iterator fixed X-Git-Tag: v0.2~204^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b833354448e4558b51e30f5c5b301e488d7f34c;p=ceph.git buffer iterator fixed --- diff --git a/src/include/buffer.h b/src/include/buffer.h index 52c22f625a9..16ac1b3927a 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -396,10 +396,17 @@ public: advance(o); } iterator(list *l, unsigned o, std::list::iterator ip, unsigned po) : - bl(l), ls(bl->_buffers), off(0), p(ip), p_off(po) { } + bl(l), ls(bl->_buffers), off(o), p(ip), p_off(po) { } iterator operator=(const iterator& other) { - return iterator(other.bl, other.off, other.p, other.p_off); + if (this != &other) { + bl = other.bl; + ls = bl->_buffers; + off = other.off; + p = other.p; + p_off = other.p_off; + } + return *this; } unsigned get_off() { return off; }