From d527fda6216780281b90f48820ae978c61c7905c Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Fri, 12 Apr 2019 10:16:49 +0900 Subject: Fix more strcmp() calls using boolean-like comparisons for result checks Such calls can confuse the reader as strcmp() uses an integer as result. The places patched here have been spotted by Thomas Munro, David Rowley and myself. Author: Michael Paquier Reviewed-by: David Rowley Discussion: https://postgr.es/m/20190411021946.GG2728@paquier.xyz --- src/backend/commands/lockcmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/commands/lockcmds.c') diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c index df681e32341..97cf0bc4add 100644 --- a/src/backend/commands/lockcmds.c +++ b/src/backend/commands/lockcmds.c @@ -219,7 +219,8 @@ LockViewRecurse_walker(Node *node, LockViewRecurse_context *context) * skipped. */ if (relid == context->viewoid && - (!strcmp(rte->eref->aliasname, "old") || !strcmp(rte->eref->aliasname, "new"))) + (strcmp(rte->eref->aliasname, "old") == 0 || + strcmp(rte->eref->aliasname, "new") == 0)) continue; /* Currently, we only allow plain tables or views to be locked. */ -- cgit v1.2.3