From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.1330.1572420044503284785 for ; Wed, 30 Oct 2019 00:20:44 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: hao.a.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2019 00:20:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,246,1569308400"; d="scan'208";a="400051996" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 30 Oct 2019 00:20:43 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 30 Oct 2019 00:20:43 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 30 Oct 2019 00:20:43 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 30 Oct 2019 00:20:43 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.225]) with mapi id 14.03.0439.000; Wed, 30 Oct 2019 15:20:41 +0800 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Zhang, Shenglei" CC: "Wang, Jian J" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Oniguruma: Remove redundant IF statement Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/Oniguruma: Remove redundant IF statement Thread-Index: AQHVh7UgnULU6pL+eEu0LZChKjpteqdy1YCQ Date: Wed, 30 Oct 2019 07:20:40 +0000 Message-ID: References: <20191021021314.26724-1-shenglei.zhang@intel.com> In-Reply-To: <20191021021314.26724-1-shenglei.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Zhang, Shenglei > Sent: Monday, October 21, 2019 10:13 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J; Wu, Hao A > Subject: [edk2-devel] [PATCH] MdeModulePkg/Oniguruma: Remove redundant > IF statement >=20 > 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 Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Signed-off-by: Shenglei Zhang > --- > .../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(-) >=20 > 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 > _key.c > +++ > b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1 > _key.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 += index, 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 + ind= ex, 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 > _key.c > +++ > b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2 > _key.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 += index, 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 + ind= ex, 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 > _key.c > +++ > b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3 > _key.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 += index, 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 + ind= ex, 3) > =3D=3D 0) { > + return index; > + } > } > + > return -1; > } > diff --git > a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfol > d_key.c > b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfol > d_key.c > index 10f7889ea372..1f03b21cfe54 100644 > --- > a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfol > d_key.c > +++ > b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfol > d_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; > } > -- > 2.18.0.windows.1 >=20 >=20 >=20