Improve indenting in _hash_pgaddtup

The Assert added in d09dbeb9b came out rather ugly after having run
pgindent on that code.  Here we adjust things to use some local variables
so that the Assert remains within the 80-character margin.

Author: Ted Yu
Discussion: https://postgr.es/m/CALte62wLSir1=x93Jf0xZvHaO009FEJfhVMFwnaR8q=csPP8kQ@mail.gmail.com
This commit is contained in:
David Rowley 2022-11-25 10:10:44 +13:00
parent 2cf41cd309
commit ec5affdbc2

View File

@ -290,12 +290,20 @@ _hash_pgaddtup(Relation rel, Buffer buf, Size itemsize, IndexTuple itup,
{
itup_off = PageGetMaxOffsetNumber(page) + 1;
#ifdef USE_ASSERT_CHECKING
/* ensure this tuple's hashkey is >= the final existing tuple */
Assert(PageGetMaxOffsetNumber(page) == 0 ||
_hash_get_indextuple_hashkey((IndexTuple)
PageGetItem(page, PageGetItemId(page,
PageGetMaxOffsetNumber(page)))) <=
_hash_get_indextuple_hashkey(itup));
if (PageGetMaxOffsetNumber(page) > 0)
{
IndexTuple lasttup;
ItemId itemid;
itemid = PageGetItemId(page, PageGetMaxOffsetNumber(page));
lasttup = (IndexTuple) PageGetItem(page, itemid);
Assert(_hash_get_indextuple_hashkey(lasttup) <=
_hash_get_indextuple_hashkey(itup));
}
#endif
}
else
{