From 44f6c2937d1cd39fdb3038cb2cee07b45ab41d4c Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Tue, 17 Mar 2009 11:04:15 +0400 Subject: [PATCH] Code clean-up. sql/sql_select.cc: the if() separate arguments checks are slightly faster. --- sql/sql_select.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3bf94bc828f..b86eb814eba 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7643,10 +7643,12 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond, /* Check if we eliminated all the predicates of the level, e.g. - (a=a AND b=b AND a=a) + (a=a AND b=b AND a=a). */ - if (!(args->elements + cond_equal.current_level.elements + eq_list.elements)) - return new Item_int((longlong) 1,1); + if (!args->elements && + !cond_equal.current_level.elements && + !eq_list.elements) + return new Item_int((longlong) 1, 1); List_iterator_fast it(cond_equal.current_level); while ((item_equal= it++))