Re: Bugfix and improvements in multixact.c

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Maxim Orlov <orlovmg(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bugfix and improvements in multixact.c
Date: 2024-06-16 17:54:16
Message-ID: 9b318abe-b234-43b0-a7c5-0d5ed9981e72@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14/06/2024 16:56, Maxim Orlov wrote:
> +static inline int
> +MXOffsetToFlagsOffset(MultiXactOffset offset)
> +{
> + int flagsoff;
> +
> + offset /= MULTIXACT_MEMBERS_PER_MEMBERGROUP;
> + offset %= MULTIXACT_MEMBERGROUPS_PER_PAGE;
> + flagsoff = offset * MULTIXACT_MEMBERGROUP_SIZE;
> +
> + return flagsoff;
> +}

I found this reuse of the 'offset' variable a bit confusing, so I added
separate local variables for each step.

Committed with that change, thanks!

--
Heikki Linnakangas
Neon (https://neon.tech)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2024-06-16 18:42:51 Re: proposal: plpgsql, new check for extra_errors - strict_expr_check
Previous Message Marcos Pegoraro 2024-06-16 17:35:38 Re: proposal: plpgsql, new check for extra_errors - strict_expr_check