Skip to content

Commit da17513

Browse files
committed
output/srzip: reduce text line length, remove "dead code"
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.
1 parent 5c52d96 commit da17513

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/output/srzip.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,8 @@ static int zip_append_queue(const struct sr_output *o,
461461
send_count = feed_unitsize ? length / feed_unitsize : 0;
462462
while (send_count) {
463463
remain = buff->alloc_size - buff->fill_size;
464+
wrptr = &buff->samples[buff->fill_size * buff->zip_unit_size];
464465
if (remain) {
465-
wrptr = &buff->samples[buff->fill_size * buff->zip_unit_size];
466466
copy_count = MIN(send_count, remain);
467467
if (sample_skip_size || sample_pad_size)
468468
copy_count = 1;
@@ -484,7 +484,6 @@ static int zip_append_queue(const struct sr_output *o,
484484
if (ret != SR_OK)
485485
return ret;
486486
buff->fill_size = 0;
487-
remain = buff->alloc_size - buff->fill_size;
488487
}
489488
}
490489

0 commit comments

Comments
 (0)