From a9f8b1a6092a923cae74221d0f1120d106d3cb8f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 29 May 2019 16:50:58 +0800 Subject: [PATCH] buffer.h: remove list::iterator_impl::advance(size_t) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/include/buffer.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/include/buffer.h b/src/include/buffer.h index 8bbede17666..7f7deed39c3 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -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(o)); } void seek(unsigned o); char operator*() const; iterator_impl& operator++();