Skip to content

Commit f00a301

Browse files
authored
dom: Minor cleanup in text.c (php#20372)
1 parent 49c3ff6 commit f00a301

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

ext/dom/text.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Modern spec URL: https://dom.spec.whatwg.org/#dom-text-splittext
9696
*/
9797
PHP_METHOD(DOMText, splitText)
9898
{
99-
zval *id;
10099
xmlChar *first;
101100
xmlChar *second;
102101
xmlNodePtr node;
@@ -105,11 +104,10 @@ PHP_METHOD(DOMText, splitText)
105104
int length;
106105
dom_object *intern;
107106

108-
id = ZEND_THIS;
109107
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &offset) == FAILURE) {
110108
RETURN_THROWS();
111109
}
112-
DOM_GET_OBJ(node, id, xmlNodePtr, intern);
110+
DOM_GET_OBJ(node, ZEND_THIS, xmlNodePtr, intern);
113111

114112
if (offset < 0) {
115113
zend_argument_value_error(1, "must be greater than or equal to 0");
@@ -155,21 +153,11 @@ Since: DOM Level 3
155153
*/
156154
PHP_METHOD(DOMText, isWhitespaceInElementContent)
157155
{
158-
zval *id;
159156
xmlNodePtr node;
160157
dom_object *intern;
161-
162-
id = ZEND_THIS;
163-
if (zend_parse_parameters_none() == FAILURE) {
164-
RETURN_THROWS();
165-
}
166-
DOM_GET_OBJ(node, id, xmlNodePtr, intern);
167-
168-
if (xmlIsBlankNode(node)) {
169-
RETURN_TRUE;
170-
} else {
171-
RETURN_FALSE;
172-
}
158+
ZEND_PARSE_PARAMETERS_NONE();
159+
DOM_GET_OBJ(node, ZEND_THIS, xmlNodePtr, intern);
160+
RETURN_BOOL(xmlIsBlankNode(node));
173161
}
174162
/* }}} end dom_text_is_whitespace_in_element_content */
175163

0 commit comments

Comments
 (0)