(copy_file_file_display_progress): remove dead code.

(file_op_total_context_t): bps_count member is unused. Remove it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2024-08-11 15:26:43 +03:00
parent 23ed903814
commit ab5bbba2dd
2 changed files with 6 additions and 18 deletions

View File

@ -1153,11 +1153,6 @@ copy_file_file_display_progress (file_op_total_context_t *tctx, file_op_context_
/* Compute total ETA and BPS */ /* Compute total ETA and BPS */
if (ctx->total_bytes != 0) if (ctx->total_bytes != 0)
{
uintmax_t remain_bytes;
remain_bytes = ctx->total_bytes - tctx->copied_bytes;
#if 1
{ {
gint64 total_secs; gint64 total_secs;
@ -1165,14 +1160,8 @@ copy_file_file_display_progress (file_op_total_context_t *tctx, file_op_context_
total_secs = MAX (1, total_secs); total_secs = MAX (1, total_secs);
tctx->bps = tctx->copied_bytes / total_secs; tctx->bps = tctx->copied_bytes / total_secs;
tctx->eta_secs = (tctx->bps != 0) ? remain_bytes / tctx->bps : 0; const uintmax_t remain_bytes = ctx->total_bytes - tctx->copied_bytes;
} tctx->eta_secs = tctx->bps != 0 ? remain_bytes / tctx->bps : 0;
#else
/* broken on lot of little files */
tctx->bps_count++;
tctx->bps = (tctx->bps * (tctx->bps_count - 1) + ctx->bps) / tctx->bps_count;
tctx->eta_secs = (tctx->bps != 0) ? remain_bytes / tctx->bps : 0;
#endif
} }
} }

View File

@ -166,7 +166,6 @@ typedef struct
uintmax_t progress_bytes; uintmax_t progress_bytes;
uintmax_t copied_bytes; uintmax_t copied_bytes;
size_t bps; size_t bps;
size_t bps_count;
gint64 transfer_start; gint64 transfer_start;
double eta_secs; double eta_secs;