mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
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:
parent
ed097e30f0
commit
3da415662a
@ -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();
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user