Skip to content

Commit 3da4156

Browse files
authored
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
1 parent ed097e3 commit 3da4156

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ext/dom/namednodemap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ PHP_METHOD(DOMNamedNodeMap, item)
142142
int count;
143143

144144
id = ZEND_THIS;
145-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
146-
RETURN_THROWS();
147-
}
145+
ZEND_PARSE_PARAMETERS_START(1, 1)
146+
Z_PARAM_LONG(index)
147+
ZEND_PARSE_PARAMETERS_END();
148148
if (index < 0 || ZEND_LONG_INT_OVFL(index)) {
149149
zend_argument_value_error(1, "must be between 0 and %d", INT_MAX);
150150
RETURN_THROWS();

ext/dom/nodelist.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ PHP_METHOD(DOMNodeList, item)
154154
int count = 0;
155155

156156
id = ZEND_THIS;
157-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
158-
RETURN_THROWS();
159-
}
157+
ZEND_PARSE_PARAMETERS_START(1, 1)
158+
Z_PARAM_LONG(index)
159+
ZEND_PARSE_PARAMETERS_END();
160160

161161
if (index >= 0) {
162162
intern = Z_DOMOBJ_P(id);

0 commit comments

Comments
 (0)