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 --- contrib/ltree/ltree_op.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'contrib') diff --git a/contrib/ltree/ltree_op.c b/contrib/ltree/ltree_op.c index 778dbf1e98..da1db5fcd2 100644 --- a/contrib/ltree/ltree_op.c +++ b/contrib/ltree/ltree_op.c @@ -91,42 +91,42 @@ Datum ltree_lt(PG_FUNCTION_ARGS) { RUNCMP; - PG_RETURN_BOOL((res < 0) ? true : false); + PG_RETURN_BOOL(res < 0); } Datum ltree_le(PG_FUNCTION_ARGS) { RUNCMP; - PG_RETURN_BOOL((res <= 0) ? true : false); + PG_RETURN_BOOL(res <= 0); } Datum ltree_eq(PG_FUNCTION_ARGS) { RUNCMP; - PG_RETURN_BOOL((res == 0) ? true : false); + PG_RETURN_BOOL(res == 0); } Datum ltree_ge(PG_FUNCTION_ARGS) { RUNCMP; - PG_RETURN_BOOL((res >= 0) ? true : false); + PG_RETURN_BOOL(res >= 0); } Datum ltree_gt(PG_FUNCTION_ARGS) { RUNCMP; - PG_RETURN_BOOL((res > 0) ? true : false); + PG_RETURN_BOOL(res > 0); } Datum ltree_ne(PG_FUNCTION_ARGS) { RUNCMP; - PG_RETURN_BOOL((res != 0) ? true : false); + PG_RETURN_BOOL(res != 0); } Datum -- cgit v1.2.3