summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorShenglei Zhang <shenglei.zhang@intel.com>2019-10-15 14:46:26 +0800
committerLiming Gao <liming.gao@intel.com>2019-11-04 08:54:24 +0800
commit2b23beb043a10dd3c00f43c1f7bb72f47554ff3a (patch)
treea19c4edc61981e9dcf9b7e07432611c67ba055b7 /MdeModulePkg/Universal
parentc18708d2f002a6ea43ed65d6c76dc4020687005c (diff)
downloadedk2-2b23beb043a10dd3c00f43c1f7bb72f47554ff3a.tar.gz
edk2-2b23beb043a10dd3c00f43c1f7bb72f47554ff3a.tar.bz2
edk2-2b23beb043a10dd3c00f43c1f7bb72f47554ff3a.zip
MdeModulePkg/Oniguruma: Remove redundant IF statement
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 <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1_key.c18
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2_key.c17
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3_key.c18
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_key.c17
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 7dbd6a5995..0aa54ee172 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
};
- if (0 == 0)
- {
- int key = hash(codes);
-
- if (key <= MAX_HASH_VALUE)
- {
- int index = wordlist[key];
-
- if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds1 + index, 1) == 0)
- return index;
- }
+ int key = hash(codes);
+ if (key <= MAX_HASH_VALUE) {
+ int index = wordlist[key];
+ if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds1 + index, 1) == 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 3d93e2417a..44f8cb6600 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
};
- if (0 == 0)
- {
- int key = hash(codes);
-
- if (key <= MAX_HASH_VALUE)
- {
- int index = wordlist[key];
-
- if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + index, 2) == 0)
- return index;
- }
+ int key = hash(codes);
+ if (key <= MAX_HASH_VALUE) {
+ int index = wordlist[key];
+ if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + index, 2) == 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 bdd5667c6a..b36500b135 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
};
- if (0 == 0)
- {
- int key = hash(codes);
-
- if (key <= MAX_HASH_VALUE)
- {
- int index = wordlist[key];
-
- if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds3 + index, 3) == 0)
- return index;
- }
+ int key = hash(codes);
+ if (key <= MAX_HASH_VALUE) {
+ int index = wordlist[key];
+ if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds3 + index, 3) == 0) {
+ return index;
+ }
}
+
return -1;
}
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_key.c
index 10f7889ea3..1f03b21cfe 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}
};
- if (0 == 0)
- {
- int key = hash(&code);
-
- if (key <= MAX_HASH_VALUE)
- {
- OnigCodePoint gcode = wordlist[key].code;
-
- if (code == gcode && wordlist[key].index >= 0)
- return &wordlist[key];
- }
+ int key = hash(&code);
+ if (key <= MAX_HASH_VALUE) {
+ OnigCodePoint gcode = wordlist[key].code;
+ if (code == gcode && wordlist[key].index >= 0) {
+ return &wordlist[key];
+ }
}
return 0;
}