summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMichael Paquier2021-09-08 00:44:04 +0000
committerMichael Paquier2021-09-08 00:44:04 +0000
commitfd0625c7a9c679c0c1e896014b8f49a489c3a245 (patch)
treecacddafcd64a4f00d87f6551b29937f9e5ced415 /contrib
parentd6c916f020e291b45563d4e76a649e9364cb6f2d (diff)
Clean up some code using "(expr) ? true : false"
All the code paths simplified here were already using a boolean or used an expression that led to zero or one, making the extra bits unnecessary. Author: Justin Pryzby Reviewed-by: Tom Lane, Michael Paquier, Peter Smith Discussion: https://postgr.es/m/20210428182936.GE27406@telsasoft.com
Diffstat (limited to 'contrib')
-rw-r--r--contrib/intarray/_int_tool.c2
-rw-r--r--contrib/ltree/ltree_gist.c2
-rw-r--r--contrib/sepgsql/selinux.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c
index 91690aff51..8ed4d63fc3 100644
--- a/contrib/intarray/_int_tool.c
+++ b/contrib/intarray/_int_tool.c
@@ -41,7 +41,7 @@ inner_int_contains(ArrayType *a, ArrayType *b)
break; /* db[j] is not in da */
}
- return (n == nb) ? true : false;
+ return (n == nb);
}
/* arguments are assumed sorted */
diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c
index 6cf181bc53..7c39ed4298 100644
--- a/contrib/ltree/ltree_gist.c
+++ b/contrib/ltree/ltree_gist.c
@@ -137,7 +137,7 @@ ltree_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
if (LTG_ISONENODE(a))
- *result = (ISEQ(LTG_NODE(a), LTG_NODE(b))) ? true : false;
+ *result = ISEQ(LTG_NODE(a), LTG_NODE(b));
else
{
int32 i;
diff --git a/contrib/sepgsql/selinux.c b/contrib/sepgsql/selinux.c
index f11968bcaa..6264d7273c 100644
--- a/contrib/sepgsql/selinux.c
+++ b/contrib/sepgsql/selinux.c
@@ -615,7 +615,7 @@ static int sepgsql_mode = SEPGSQL_MODE_INTERNAL;
bool
sepgsql_is_enabled(void)
{
- return (sepgsql_mode != SEPGSQL_MODE_DISABLED ? true : false);
+ return (sepgsql_mode != SEPGSQL_MODE_DISABLED);
}
/*