]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
buffer iterator fixed
authorSage Weil <sage@newdream.net>
Wed, 16 Apr 2008 16:34:33 +0000 (09:34 -0700)
committerSage Weil <sage@newdream.net>
Wed, 16 Apr 2008 16:34:33 +0000 (09:34 -0700)
src/include/buffer.h

index 52c22f625a93cfc72cf15bf5fe0e3dd0b4e7ff18..16ac1b3927a1134f06da2c642a19eb07065bfcde 100644 (file)
@@ -396,10 +396,17 @@ public:
        advance(o);
       }
       iterator(list *l, unsigned o, std::list<ptr>::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; }