From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7B18022EBA for ; Mon, 22 Apr 2019 14:34:43 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9ZMEPHt-kKxV for ; Mon, 22 Apr 2019 14:34:43 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 37C5D22DCD for ; Mon, 22 Apr 2019 14:34:43 -0400 (EDT) From: Vladislav Shpilevoy Subject: [tarantool-patches] [PATCH 1/1] sql: drop a useless check from lookupName() Date: Mon, 22 Apr 2019 21:34:40 +0300 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: kyukhin@tarantool.org There was a variable used as a counter from 0 to uint32_t space_def->field_count. Obviously it can't be < 0, but there was a check for that. Drop it. The check was revealed during SQL BOOLEAN review, where one of patches gets rid of some explicit Expr.type assignments. --- Branch: https://github.com/tarantool/tarantool/tree/gerold103/drop-useless-check-from-resolve src/box/sql/resolve.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c index f601bca7b..504096e6d 100644 --- a/src/box/sql/resolve.c +++ b/src/box/sql/resolve.c @@ -337,18 +337,11 @@ lookupName(Parse * pParse, /* The parsing context */ } if (iCol < (int)space_def->field_count) { cnt++; - if (iCol < 0) { - pExpr->type = - FIELD_TYPE_INTEGER; - } else { - uint64_t *mask = - pExpr->iTable == 0 ? - &pParse->oldmask : - &pParse->newmask; - column_mask_set_fieldno(mask, - iCol); - } - pExpr->iColumn = (i16) iCol; + uint64_t *mask = pExpr->iTable == 0 ? + &pParse->oldmask : + &pParse->newmask; + column_mask_set_fieldno(mask, iCol); + pExpr->iColumn = iCol; pExpr->space_def = space_def; isTrigger = 1; } -- 2.20.1 (Apple Git-117)