pgsql: Minor code-cleanliness improvements for btree.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Minor code-cleanliness improvements for btree.
Date: 2017-09-18 20:36:34
Message-ID: E1du2mQ-0007nw-Rs@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Minor code-cleanliness improvements for btree.

Make the btree page-flags test macros (P_ISLEAF and friends) return clean
boolean values, rather than values that might not fit in a bool. Use them
in a few places that were randomly referencing the flag bits directly.

In passing, change access/nbtree/'s only direct use of BUFFER_LOCK_SHARE to
BT_READ. (Some think we should go the other way, but as long as we have
BT_READ/BT_WRITE, let's use them consistently.)

Masahiko Sawada, reviewed by Doug Doole

Discussion: https://postgr.es/m/CAD21AoBmWPeN=WBB5Jvyz_Nt3rmW1ebUyAnk3ZbJP3RMXALJog@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/eb5c404b17752ca566947f12cb702438dcccdcb1

Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 4 ++--
contrib/pgstattuple/pgstattuple.c | 2 +-
src/backend/access/nbtree/nbtpage.c | 6 +++---
src/backend/access/nbtree/nbtxlog.c | 4 ++--
src/include/access/nbtree.h | 16 ++++++++--------
5 files changed, 16 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Meskes 2017-09-18 21:08:55 pgsql: Fixed ECPG to correctly handle out-of-scope cursor declarations
Previous Message Tom Lane 2017-09-18 20:01:21 pgsql: Make ExplainOpenGroup and ExplainCloseGroup public.