From nobody Wed May 8 15:40:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+49268+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49268+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1571624004; cv=none; d=zoho.com; s=zohoarc; b=PcGioy1Uxs+UXeUmwhO98/aeG4SN7+ndDvsO5371EXFHaQcLO3c4YcS5fFf933e+9YUCqYshu3AFqK4iITIPv2EQYwKFjtHwZCVN1EW4ycQpkoiD54P+OZVQE+hYW0o3lVtkLzEmFzmQC0381ANd9sHx2wxFsSbDm4d9z4pgNr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571624004; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=SHIPEBbFtgJZESoBEqSEEW7V7imUqqYxvVVPMRZOtCE=; b=hIpp5v4L0JutTydpG4yEovQUM/batkQbcOG+QRb/94XUdZFjXjaMisymVDQ9YukUN52AE/TP/jm61p1XfP5GiL0SRcFCcKpZ76klCkRDDOc0Rd2UV3A/sOkZI14I6ACKwk09/p45Yi+JugX2e2fBxWLmB2MhhC3Nz7cDSk+HVDA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49268+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157162400467360.11081181547422; Sun, 20 Oct 2019 19:13:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1IT5YY1788612x1NHrVPYVpc; Sun, 20 Oct 2019 19:13:24 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.46.1571624003378784627 for ; Sun, 20 Oct 2019 19:13:23 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 19:13:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,321,1566889200"; d="scan'208";a="201242490" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga006.jf.intel.com with ESMTP; 20 Oct 2019 19:13:21 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu Subject: [edk2-devel] [PATCH] MdeModulePkg/Oniguruma: Remove redundant IF statement Date: Mon, 21 Oct 2019 10:13:14 +0800 Message-Id: <20191021021314.26724-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: MBbbgmfWY0Dgm6KegKYz1dG4x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1571624004; bh=LmaeVYy4Ac1wcJpWVoV6Mc/tiaNzc+jw0diYwiLEMl4=; h=Cc:Date:From:Reply-To:Subject:To; b=hwIcpA3PyfsXel/MtiUwI0F55xPxHNBAq0JI/utXvzeW86wnLM+AMX4LId3HEDSBh3F kDU8YfONlED4YOW60gINq0vpUpJj9eFK8i1zPmm292O07r4tPKA1FpjtynSgQo3AzjbSc oQh2QOnz74+eXUFAH/sHKUWLg0S/l+/hGms= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The if statement is not necessary, so keep it to edk2 style. And this change has been merged to onigruma. REF:https://github.com/kkos/oniguruma/pull/158 Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- .../Oniguruma/unicode_fold1_key.c | 18 +++++++----------- .../Oniguruma/unicode_fold2_key.c | 17 ++++++----------- .../Oniguruma/unicode_fold3_key.c | 18 +++++++----------- .../Oniguruma/unicode_unfold_key.c | 17 ++++++----------- 4 files changed, 26 insertions(+), 44 deletions(-) diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_= fold1_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode= _fold1_key.c index 7dbd6a5995be..0aa54ee172b2 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1_k= ey.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1_k= ey.c @@ -2983,17 +2983,13 @@ onigenc_unicode_fold1_key(OnigCodePoint codes[]) 4026 }; =20 - if (0 =3D=3D 0) - { - int key =3D hash(codes); - - if (key <=3D MAX_HASH_VALUE) - { - int index =3D wordlist[key]; - - if (index >=3D 0 && onig_codes_cmp(codes, OnigUnicodeFolds1 + in= dex, 1) =3D=3D 0) - return index; - } + int key =3D hash(codes); + if (key <=3D MAX_HASH_VALUE) { + int index =3D wordlist[key]; + if (index >=3D 0 && onig_codes_cmp(codes, OnigUnicodeFolds1 + index,= 1) =3D=3D 0) { + return index; + } } + return -1; } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_= fold2_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode= _fold2_key.c index 3d93e2417a2c..44f8cb660071 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2_k= ey.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2_k= ey.c @@ -211,17 +211,12 @@ onigenc_unicode_fold2_key(OnigCodePoint codes[]) 129 }; =20 - if (0 =3D=3D 0) - { - int key =3D hash(codes); - - if (key <=3D MAX_HASH_VALUE) - { - int index =3D wordlist[key]; - - if (index >=3D 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + in= dex, 2) =3D=3D 0) - return index; - } + int key =3D hash(codes); + if (key <=3D MAX_HASH_VALUE) { + int index =3D wordlist[key]; + if (index >=3D 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + index,= 2) =3D=3D 0) + return index; } + return -1; } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_= fold3_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode= _fold3_key.c index bdd5667c6ae2..b36500b135e6 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3_k= ey.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3_k= ey.c @@ -121,17 +121,13 @@ onigenc_unicode_fold3_key(OnigCodePoint codes[]) 0 }; =20 - if (0 =3D=3D 0) - { - int key =3D hash(codes); - - if (key <=3D MAX_HASH_VALUE) - { - int index =3D wordlist[key]; - - if (index >=3D 0 && onig_codes_cmp(codes, OnigUnicodeFolds3 + in= dex, 3) =3D=3D 0) - return index; - } + int key =3D hash(codes); + if (key <=3D MAX_HASH_VALUE) { + int index =3D wordlist[key]; + if (index >=3D 0 && onig_codes_cmp(codes, OnigUnicodeFolds3 + index,= 3) =3D=3D 0) { + return index; + } } + return -1; } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_= unfold_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicod= e_unfold_key.c index 10f7889ea372..1f03b21cfe54 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_= key.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_= key.c @@ -3288,17 +3288,12 @@ onigenc_unicode_unfold_key(OnigCodePoint code) {0x1e907, 4005, 1} }; =20 - if (0 =3D=3D 0) - { - int key =3D hash(&code); - - if (key <=3D MAX_HASH_VALUE) - { - OnigCodePoint gcode =3D wordlist[key].code; - - if (code =3D=3D gcode && wordlist[key].index >=3D 0) - return &wordlist[key]; - } + int key =3D hash(&code); + if (key <=3D MAX_HASH_VALUE) { + OnigCodePoint gcode =3D wordlist[key].code; + if (code =3D=3D gcode && wordlist[key].index >=3D 0) { + return &wordlist[key]; + } } return 0; } --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49268): https://edk2.groups.io/g/devel/message/49268 Mute This Topic: https://groups.io/mt/36262345/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-