Skip to content

Commit 9300a50

Browse files
authored
Reduce code size of strripos() (#20358)
Reduction of 1325 -> 1213 on x86-64 with GCC 15.2.1.
1 parent 4bd3a90 commit 9300a50

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ext/standard/string.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,13 +2109,11 @@ PHP_FUNCTION(strripos)
21092109
needle_dup = zend_string_tolower(needle);
21102110
if ((found = (char *)zend_memnrstr(p, ZSTR_VAL(needle_dup), ZSTR_LEN(needle_dup), e))) {
21112111
RETVAL_LONG(found - ZSTR_VAL(haystack_dup));
2112-
zend_string_release_ex(needle_dup, 0);
2113-
zend_string_release_ex(haystack_dup, 0);
21142112
} else {
2115-
zend_string_release_ex(needle_dup, 0);
2116-
zend_string_release_ex(haystack_dup, 0);
2117-
RETURN_FALSE;
2113+
RETVAL_FALSE;
21182114
}
2115+
zend_string_release_ex(needle_dup, false);
2116+
zend_string_release_ex(haystack_dup, false);
21192117
}
21202118
/* }}} */
21212119

0 commit comments

Comments
 (0)