1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Reduce code size of strripos() (#20358)

Reduction of 1325 -> 1213 on x86-64 with GCC 15.2.1.
This commit is contained in:
Niels Dossche
2025-11-02 15:07:15 +01:00
committed by GitHub
parent 4bd3a9006e
commit 9300a5076d

View File

@@ -2109,13 +2109,11 @@ PHP_FUNCTION(strripos)
needle_dup = zend_string_tolower(needle);
if ((found = (char *)zend_memnrstr(p, ZSTR_VAL(needle_dup), ZSTR_LEN(needle_dup), e))) {
RETVAL_LONG(found - ZSTR_VAL(haystack_dup));
zend_string_release_ex(needle_dup, 0);
zend_string_release_ex(haystack_dup, 0);
} else {
zend_string_release_ex(needle_dup, 0);
zend_string_release_ex(haystack_dup, 0);
RETURN_FALSE;
RETVAL_FALSE;
}
zend_string_release_ex(needle_dup, false);
zend_string_release_ex(haystack_dup, false);
}
/* }}} */