Re: Bugfix and improvements in multixact.c - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Bugfix and improvements in multixact.c
Date
Msg-id 9b318abe-b234-43b0-a7c5-0d5ed9981e72@iki.fi
Whole thread Raw
In response to Bugfix and improvements in multixact.c  (Maxim Orlov <orlovmg@gmail.com>)
List 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)




pgsql-hackers by date:

Previous
From: Marcos Pegoraro
Date:
Subject: Re: proposal: plpgsql, new check for extra_errors - strict_expr_check
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql, new check for extra_errors - strict_expr_check