From 68f7c4b57a27dbcd3e93ba3ff7b0b49664b25e09 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 11 Oct 2021 09:36:42 +0900 Subject: Clean up more code using "(expr) ? true : false" This is similar to fd0625c, taking care of any remaining code paths that are worth the cleanup. This also changes some cases using opposite expression patterns. Author: Justin Pryzby, Masahiko Sawada Discussion: https://postgr.es/m/CAD21AoCdF8dnUvr-BUWWGvA_XhKSoANacBMZb6jKyCk4TYfQ2Q@mail.gmail.com --- src/backend/access/gist/gistsplit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/access/gist/gistsplit.c') diff --git a/src/backend/access/gist/gistsplit.c b/src/backend/access/gist/gistsplit.c index 853ebc387b4..1c5d4e9ca22 100644 --- a/src/backend/access/gist/gistsplit.c +++ b/src/backend/access/gist/gistsplit.c @@ -421,8 +421,8 @@ gistUserPicksplit(Relation r, GistEntryVector *entryvec, int attno, GistSplitVec * Prepare spl_ldatum/spl_rdatum/spl_ldatum_exists/spl_rdatum_exists in * case we are doing a secondary split (see comments in gist.h). */ - sv->spl_ldatum_exists = (v->spl_lisnull[attno]) ? false : true; - sv->spl_rdatum_exists = (v->spl_risnull[attno]) ? false : true; + sv->spl_ldatum_exists = !(v->spl_lisnull[attno]); + sv->spl_rdatum_exists = !(v->spl_risnull[attno]); sv->spl_ldatum = v->spl_lattr[attno]; sv->spl_rdatum = v->spl_rattr[attno]; @@ -451,8 +451,8 @@ gistUserPicksplit(Relation r, GistEntryVector *entryvec, int attno, GistSplitVec * Reinit GIST_SPLITVEC. Although these fields are not used by * genericPickSplit(), set them up for further processing */ - sv->spl_ldatum_exists = (v->spl_lisnull[attno]) ? false : true; - sv->spl_rdatum_exists = (v->spl_risnull[attno]) ? false : true; + sv->spl_ldatum_exists = !(v->spl_lisnull[attno]); + sv->spl_rdatum_exists = !(v->spl_risnull[attno]); sv->spl_ldatum = v->spl_lattr[attno]; sv->spl_rdatum = v->spl_rattr[attno]; -- cgit v1.2.3