Re: [PATCH v2 2/4] progress: assemble percentage and counters in a strbuf before printing
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 2, 2019, 05:45 UTC
- Message-ID
- <CAPig+cRMBmfG1YDeP9t9eLZdqMqthfxp6nviQYGr7qNEA2U54Q@mail.gmail.com>
- In-Reply-To
- <20190401115217.3423-3-szeder.dev@gmail.com>
On Mon, Apr 1, 2019 at 7:52 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 21 quoted lines
> [...]
> To prepare for those changes assemble the changing parts in a separate
> strbuf kept in 'struct progress' before printing.
>
> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
> ---
> diff --git a/progress.c b/progress.c
> @@ -80,36 +81,42 @@ static int is_foreground_fd(int fd)
> static void display(struct progress *progress, uint64_t n, const char *done)
> {
> if (progress->total) {
> if (percent != progress->last_percent || progress_update) {
> [...]
> - progress_update = 0;
> - return;
> }
> + if (show_update) {
> [...]
> progress_update = 0;
> - return;
> }Removal of these two 'returns' is unrelated to the change made by this patch and should have been done by 1/4.
> return;
Likewise, this final 'return' doesn't need to be here and should go away in 1/4.