Skip to content

Commit 4a12745

Browse files
authored
xml: Optimize attribute array construction (#20515)
Attributes can't be numeric strings by the definition of the grammar, so don't bother with the symbol table stuff.
1 parent 1d4b53a commit 4a12745

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/xml/xml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha
648648
val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding);
649649

650650
ZVAL_STR(&tmp, val);
651-
zend_symtable_update(Z_ARRVAL(args[2]), att, &tmp);
651+
zend_hash_update(Z_ARRVAL(args[2]), att, &tmp);
652652

653653
attributes += 2;
654654

@@ -688,7 +688,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha
688688
val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding);
689689

690690
ZVAL_STR(&tmp, val);
691-
zend_symtable_update(Z_ARRVAL(atr), att, &tmp);
691+
zend_hash_update(Z_ARRVAL(atr), att, &tmp);
692692

693693
atcnt++;
694694
attributes += 2;

0 commit comments

Comments
 (0)