Skip to content

Commit 674473d

Browse files
authored
ext/xsl: add const qualifiers when iteration over a CE's parents (#21513)
And rename the variables to proper English.
1 parent 118fa2c commit 674473d

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

ext/xsl/xsltprocessor.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,20 +430,18 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
430430

431431
if (newdocp) {
432432
if (ret_class) {
433-
zend_string *curclass_name;
434-
zend_class_entry *curce;
435433
php_libxml_node_object *interndoc;
436434

437-
curce = Z_OBJCE_P(docp);
438-
curclass_name = curce->name;
439-
while (curce->parent != NULL) {
440-
curce = curce->parent;
435+
const zend_class_entry *current_ce = Z_OBJCE_P(docp);
436+
const zend_string *current_class_name = current_ce->name;
437+
while (current_ce->parent != NULL) {
438+
current_ce = current_ce->parent;
441439
}
442440

443-
if (!instanceof_function(ret_class, curce)) {
441+
if (!instanceof_function(ret_class, current_ce)) {
444442
xmlFreeDoc(newdocp);
445443
zend_argument_type_error(2, "must be a class name compatible with %s, %s given",
446-
ZSTR_VAL(curclass_name), ZSTR_VAL(ret_class->name)
444+
ZSTR_VAL(current_class_name), ZSTR_VAL(ret_class->name)
447445
);
448446
RETURN_THROWS();
449447
}

0 commit comments

Comments
 (0)