From d6b4ff02202b5af6dc4ce4d315a080cc2e8c24ab Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 10 Oct 2012 09:30:27 +0300 Subject: [PATCH] type: simplify get_binop_type() Move a test for NULL a couple lines earlier. Signed-off-by: Dan Carpenter --- smatch_type.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/smatch_type.c b/smatch_type.c index 1de6073f..8e808a6b 100644 --- a/smatch_type.c +++ b/smatch_type.c @@ -31,14 +31,14 @@ static struct symbol *get_binop_type(struct expression *expr) left = get_type(expr->left); right = get_type(expr->right); - if (left && (left->type == SYM_PTR || left->type == SYM_ARRAY)) - return left; - if (right && (right->type == SYM_PTR || right->type == SYM_ARRAY)) - return right; - if (!left || !right) return NULL; + if (left->type == SYM_PTR || left->type == SYM_ARRAY) + return left; + if (right->type == SYM_PTR || right->type == SYM_ARRAY) + return right; + if (type_max(left) < type_max(&int_ctype) && type_max(right) < type_max(&int_ctype)) return &int_ctype; -- 2.11.4.GIT