Re: indentation in _hash_pgaddtup()
От | Ted Yu |
---|---|
Тема | Re: indentation in _hash_pgaddtup() |
Дата | |
Msg-id | CALte62zk62wtP6uz1tQRRVRohCxJe_wVWTabUjkCKkWd2ZTAzA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: indentation in _hash_pgaddtup() (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: indentation in _hash_pgaddtup()
|
Список | pgsql-hackers |
On Thu, Nov 24, 2022 at 7:11 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Daniel Gustafsson <daniel@yesql.se> writes:
>> On 24 Nov 2022, at 13:42, Ted Yu <yuzhihong@gmail.com> wrote:
>> In _hash_pgaddtup(), it seems the indentation is off for the assertion.
> Indentation is handled by applying src/tools/pgindent to the code, and
> re-running it on this file yields no re-indentation so this is in fact correct
> according to the pgindent rules.
It is one messy bit of code though --- perhaps a little more thought
about where to put line breaks would help? Alternatively, it could
be split into multiple statements, along the lines of
#ifdef USE_ASSERT_CHECKING
if (PageGetMaxOffsetNumber(page) > 0)
{
IndexTuple lasttup = PageGetItem(page,
PageGetItemId(page,
PageGetMaxOffsetNumber(page)));
Assert(_hash_get_indextuple_hashkey(lasttup) <=
_hash_get_indextuple_hashkey(itup));
}
#endif
(details obviously tweakable)
regards, tom lane
Thanks Tom for the suggestion.
Here is patch v2.
Вложения
В списке pgsql-hackers по дате отправления: