blob: 6a1213e4f5c6c9f586f629244edce8a68e08bcfc (
plain) (
tree)
|
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
void
shiftbuffer(struct algorithm *algorithms, size_t nalgorithms, struct buffer *buffer)
{
size_t i, consumed = SIZE_MAX;
for (i = 0; i < nalgorithms; i++)
consumed = MIN(consumed, algorithms[i].offset);
if (!consumed)
return;
for (i = 0; i < nalgorithms; i++)
algorithms[i].offset -= consumed;
memmove(&buffer->buf[0], &buffer->buf[consumed], buffer->length -= consumed);
}
|