Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bufq: remove Curl_bufq_skip_and_shift (unused) #11915

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 0 additions & 22 deletions lib/bufq.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down
6 changes: 0 additions & 6 deletions lib/bufq.h
Expand Up @@ -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);
Expand Down