pgsql: Remove some pointless code in block.h.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove some pointless code in block.h.
Date: 2022-03-04 00:15:50
Message-ID: E1nPvbp-000nRE-U2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove some pointless code in block.h.

There's no visible point in casting the result of a comparison to
bool, because it already is that, at least on C99 compilers.

I see no point in these assertions that a pointer we're about to
dereference isn't null, either. If it is, the resulting SIGSEGV
will notify us of the problem just fine.

Noted while reviewing Zhihong Yu's patch. This is basically
cosmetic, so no need for back-patch.

Discussion: https://postgr.es/m/CALNJ-vT9r0DSsAOw9OXVJFxLENoVS_68kJ5x0p44atoYH+H4dg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8134fe4ad80a1f9673770126ed7c45045b8ef467

Modified Files
--------------
src/include/storage/block.h | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2022-03-04 00:51:36 pgsql: doc: Fix description of pg_stop_backup()
Previous Message Tom Lane 2022-03-04 00:04:25 pgsql: Fix bogus casting in BlockIdGetBlockNumber().