From 87568bd20511e4ee78c241a3e127ac4215c19d7a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 26 Feb 2022 11:08:03 -0800 Subject: [PATCH] expr: [nfc] remove unnecessary parens and dereference of 'matchf' The C compiler knows how to dereference and call through a function pointer without needing this manual instruction. --- lib/expr/exeval.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/expr/exeval.c b/lib/expr/exeval.c index f9f14cd7d..2762dd366 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -1303,7 +1303,10 @@ eval(Expr_t* ex, Exnode_t* expr, void* env) break; continue; case STRING: - if ((ex->disc->version >= 19981111L && ex->disc->matchf) ? (*ex->disc->matchf)(ex, x, (*t)->string, expr->data.operand.left, v.string, env, ex->disc) : strmatch((*t)->string, v.string)) + if ((ex->disc->version >= 19981111L && ex->disc->matchf) + ? ex->disc->matchf(ex, x, (*t)->string, expr->data.operand.left, + v.string, env, ex->disc) + : strmatch((*t)->string, v.string)) break; continue; case FLOATING: @@ -1975,7 +1978,13 @@ eval(Expr_t* ex, Exnode_t* expr, void* env) return tmp.data.constant.value; case EQ: case NE: - v.integer = ((v.string && r.string) ? ((ex->disc->version >= 19981111L && ex->disc->matchf) ? (*ex->disc->matchf)(ex, expr->data.operand.left, v.string, expr->data.operand.right, r.string, env, ex->disc) : strmatch(v.string, r.string)) : (v.string == r.string)) == (expr->op == EQ); + v.integer = ((v.string && r.string) + ? ((ex->disc->version >= 19981111L && ex->disc->matchf) + ? ex->disc->matchf(ex, expr->data.operand.left, v.string, + expr->data.operand.right, r.string, env, + ex->disc) + : strmatch(v.string, r.string)) + : (v.string == r.string)) == (expr->op == EQ); return v; case '+': v.string = str_add(ex, v.string, r.string); -- 2.40.0