Switch DOMNodeList::item() and DOMNamedNodeMap::item() to fast ZPP (#11361)

Code size impact:
* DOMNodeList::item() => +96 bytes hot, +31 bytes cold
* DOMNamedNodeMap::item() => +57 bytes hot, +31 bytes cold
This commit is contained in:
Niels Dossche 2023-06-04 15:20:04 +02:00 committed by GitHub
parent ed097e30f0
commit 3da415662a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -142,9 +142,9 @@ PHP_METHOD(DOMNamedNodeMap, item)
int count; int count;
id = ZEND_THIS; id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) { ZEND_PARSE_PARAMETERS_START(1, 1)
RETURN_THROWS(); Z_PARAM_LONG(index)
} ZEND_PARSE_PARAMETERS_END();
if (index < 0 || ZEND_LONG_INT_OVFL(index)) { if (index < 0 || ZEND_LONG_INT_OVFL(index)) {
zend_argument_value_error(1, "must be between 0 and %d", INT_MAX); zend_argument_value_error(1, "must be between 0 and %d", INT_MAX);
RETURN_THROWS(); RETURN_THROWS();

View File

@ -154,9 +154,9 @@ PHP_METHOD(DOMNodeList, item)
int count = 0; int count = 0;
id = ZEND_THIS; id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) { ZEND_PARSE_PARAMETERS_START(1, 1)
RETURN_THROWS(); Z_PARAM_LONG(index)
} ZEND_PARSE_PARAMETERS_END();
if (index >= 0) { if (index >= 0) {
intern = Z_DOMOBJ_P(id); intern = Z_DOMOBJ_P(id);