]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
buffer.h: remove list::iterator_impl::advance(size_t) 28278/head
authorKefu Chai <kchai@redhat.com>
Wed, 29 May 2019 08:50:58 +0000 (16:50 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 29 May 2019 15:54:50 +0000 (23:54 +0800)
quote from Radoslaw's comment

> In general we could remove it as the `buffer` library tends to
> disrespects `size_t` – `list::_len` and `ptr::_len` are both
`unsigned`.
> There are some exceptions like `size_t buffer::ptr::get_offset()`
(used
> altogether with `::advance` in `denc.h`) but they deserve rework as
> well.

and in this very case, we simply cast `size_t` to `unsigned`. so we
could silently trim a 64bits integer to 32bit on 64bits architecture.

so for better portability, we can just remove it. also, this function is
inlined, so the ABI is not changed.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/buffer.h

index 8bbede17666bb6583ff7c6f0b2604ef3db63e1e5..7f7deed39c31ec324721fe7c32971923b96f2c45 100644 (file)
@@ -727,9 +727,7 @@ inline namespace v14_2_0 {
        //return off == bl->length();
       }
 
-      void advance(int o) = delete;
       void advance(unsigned o);
-      void advance(size_t o) { advance(static_cast<unsigned>(o)); }
       void seek(unsigned o);
       char operator*() const;
       iterator_impl& operator++();