com php-src: Remove code duplication: ext/mbstring/php_mbrege x.c
| From: | Nikita Popov | Date: | Wed, 20 Jun 2018 13:05:08 +0000 |
| Subject: | com php-src: Remove code duplication: ext/mbstring/php_mbrege x.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-102209@lists.php.net to get a copy of this message | ||
Commit: e357f67faf04503ba0f33c603acef89dc38db51a
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 20 Jun 2018 15:05:08 +0200
Parents: 8e2f0824f7a65f79d0dc077d3203fb221042ae80
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e357f67faf04503ba0f33c603acef89dc38db51a
Log:
Remove code duplication
And fix indentation
Changed paths:
M ext/mbstring/php_mbregex.c
Diff:
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index f379185..4d3e44f 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -700,23 +700,19 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
RETURN_FALSE;
}
- if (!php_mb_check_encoding(
- string,
- string_len,
- _php_mb_regex_mbctype2name(MBREX(current_mbctype))
- )) {
- if (array != NULL) {
- zval_dtor(array);
- array_init(array);
- }
- RETURN_FALSE;
- }
-
if (array != NULL) {
zval_dtor(array);
array_init(array);
}
+ if (!php_mb_check_encoding(
+ string,
+ string_len,
+ _php_mb_regex_mbctype2name(MBREX(current_mbctype))
+ )) {
+ RETURN_FALSE;
+ }
+
options = MBREX(regex_default_options);
if (icase) {
options |= ONIG_OPTION_IGNORECASE;