Skip to content

Commit cd688d2

Browse files
committed
Remove null check
1 parent 14aee57 commit cd688d2

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

ext/intl/grapheme/grapheme_string.c

+7-21
Original file line numberDiff line numberDiff line change
@@ -983,9 +983,7 @@ PHP_FUNCTION(grapheme_levenshtein)
983983
intl_error_set_code(NULL, ustatus1);
984984

985985
intl_error_set_custom_msg(NULL, "Error converting input string to UTF-16", 0);
986-
if (ustring1) {
987-
efree(ustring1);
988-
}
986+
efree(ustring1);
989987
RETURN_FALSE;
990988
}
991989

@@ -995,12 +993,8 @@ PHP_FUNCTION(grapheme_levenshtein)
995993
intl_error_set_code(NULL, ustatus2);
996994

997995
intl_error_set_custom_msg(NULL, "Error converting input string to UTF-16", 0);
998-
if (ustring2) {
999-
efree(ustring2);
1000-
}
1001-
if (ustring1) {
1002-
efree(ustring1);
1003-
}
996+
efree(ustring2);
997+
efree(ustring1);
1004998
RETURN_FALSE;
1005999
}
10061000

@@ -1032,12 +1026,8 @@ PHP_FUNCTION(grapheme_levenshtein)
10321026
intl_error_set_code(NULL, ustatus1);
10331027

10341028
intl_error_set_custom_msg(NULL, "Error on ubrk_setText on ustring1", 0);
1035-
if (ustring2) {
1036-
efree(ustring2);
1037-
}
1038-
if (ustring1) {
1039-
efree(ustring1);
1040-
}
1029+
efree(ustring2);
1030+
efree(ustring1);
10411031
RETURN_FALSE;
10421032
}
10431033

@@ -1046,12 +1036,8 @@ PHP_FUNCTION(grapheme_levenshtein)
10461036
intl_error_set_code(NULL, ustatus2);
10471037

10481038
intl_error_set_custom_msg(NULL, "Error on ubrk_setText on ustring2", 0);
1049-
if (ustring2) {
1050-
efree(ustring2);
1051-
}
1052-
if (ustring1) {
1053-
efree(ustring1);
1054-
}
1039+
efree(ustring2);
1040+
efree(ustring1);
10551041
RETURN_FALSE;
10561042
}
10571043

0 commit comments

Comments
 (0)