Move an instruction to reduce its text line length. Also happens to put
the calculation of remaining buffer space and the current write position
in closer proximity, improving maintainability in the process.
Remove an assignment after appending to the archive and before iterating
the input samples loop again. Eliminates code that never took effect.
The value gets determined at the loop body's start anyway.
send_count = feed_unitsize ? length / feed_unitsize : 0;
while (send_count) {
remain = buff->alloc_size - buff->fill_size;
+ wrptr = &buff->samples[buff->fill_size * buff->zip_unit_size];
if (remain) {
- wrptr = &buff->samples[buff->fill_size * buff->zip_unit_size];
copy_count = MIN(send_count, remain);
if (sample_skip_size || sample_pad_size)
copy_count = 1;
if (ret != SR_OK)
return ret;
buff->fill_size = 0;
- remain = buff->alloc_size - buff->fill_size;
}
}