Re: Small patch modifying variable name to reflect the logic involved

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Krishnakumar R <kksrcv001(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small patch modifying variable name to reflect the logic involved
Date: 2023-09-14 09:30:54
Message-ID: C37DEA93-26D9-49C6-AAB6-39AEB6B046DD@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 14 Sep 2023, at 08:28, Krishnakumar R <kksrcv001(at)gmail(dot)com> wrote:

> Please find a small patch to improve code readability by modifying
> variable name to reflect the logic involved - finding diff between end
> and start time of WAL sync.

- INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, duration, start);
+ INSTR_TIME_SET_CURRENT(end);
+ INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, end, start);

Agreed, the duration is the result of the INSTR_TIME_ACCUM_DIFF calculation,
not what's stored in the instr_time variable.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-09-14 09:39:20 Re: [PATCH] Add native windows on arm64 support
Previous Message Daniel Gustafsson 2023-09-14 09:23:09 Re: Quoting filename in using facing log messages