Drop redundant ifs.

This commit is contained in:
Themaister 2012-01-31 19:14:48 +01:00
parent f2264ebb3e
commit f669f02407

View File

@ -77,8 +77,7 @@ void fifo_write(fifo_buffer_t *buffer, const void *in_buf, size_t size)
}
memcpy(buffer->buffer + buffer->end, in_buf, first_write);
if (rest_write > 0)
memcpy(buffer->buffer, (const uint8_t*)in_buf + first_write, rest_write);
memcpy(buffer->buffer, (const uint8_t*)in_buf + first_write, rest_write);
buffer->end = (buffer->end + size) % buffer->bufsize;
}
@ -95,8 +94,7 @@ void fifo_read(fifo_buffer_t *buffer, void *in_buf, size_t size)
}
memcpy(in_buf, (const uint8_t*)buffer->buffer + buffer->first, first_read);
if (rest_read > 0)
memcpy((uint8_t*)in_buf + first_read, buffer->buffer, rest_read);
memcpy((uint8_t*)in_buf + first_read, buffer->buffer, rest_read);
buffer->first = (buffer->first + size) % buffer->bufsize;
}