From: Daniel Stenberg Date: Fri, 22 Sep 2023 12:01:07 +0000 (+0200) Subject: bufq: remove Curl_bufq_skip_and_shift (unused) X-Git-Tag: curl-8_4_0~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5595e3361767cd87e2d6fff5d88724d91a978700;p=thirdparty%2Fcurl.git bufq: remove Curl_bufq_skip_and_shift (unused) Closes #11915 --- diff --git a/lib/bufq.c b/lib/bufq.c index 155544993d..d03906d166 100644 --- a/lib/bufq.c +++ b/lib/bufq.c @@ -144,21 +144,6 @@ static size_t chunk_skip(struct buf_chunk *chunk, size_t amount) return n; } -static void chunk_shift(struct buf_chunk *chunk) -{ - if(chunk->r_offset) { - if(!chunk_is_empty(chunk)) { - size_t n = chunk->w_offset - chunk->r_offset; - memmove(chunk->x.data, chunk->x.data + chunk->r_offset, n); - chunk->w_offset -= chunk->r_offset; - chunk->r_offset = 0; - } - else { - chunk->r_offset = chunk->w_offset = 0; - } - } -} - static void chunk_list_free(struct buf_chunk **anchor) { struct buf_chunk *chunk; @@ -504,13 +489,6 @@ void Curl_bufq_skip(struct bufq *q, size_t amount) } } -void Curl_bufq_skip_and_shift(struct bufq *q, size_t amount) -{ - Curl_bufq_skip(q, amount); - if(q->tail) - chunk_shift(q->tail); -} - ssize_t Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer, void *writer_ctx, CURLcode *err) { diff --git a/lib/bufq.h b/lib/bufq.h index 89b5c84efe..089d61bfe4 100644 --- a/lib/bufq.h +++ b/lib/bufq.h @@ -209,12 +209,6 @@ bool Curl_bufq_peek_at(struct bufq *q, size_t offset, */ void Curl_bufq_skip(struct bufq *q, size_t amount); -/** - * Same as `skip` but shift tail data to the start afterwards, - * so that further writes will find room in tail. - */ -void Curl_bufq_skip_and_shift(struct bufq *q, size_t amount); - typedef ssize_t Curl_bufq_writer(void *writer_ctx, const unsigned char *buf, size_t len, CURLcode *err);