1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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.
This commit is contained in:
Niels Dossche
2025-11-18 09:49:13 -08:00
committed by GitHub
parent 1d4b53a36f
commit 4a12745705

View File

@@ -648,7 +648,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha
val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding);
ZVAL_STR(&tmp, val);
zend_symtable_update(Z_ARRVAL(args[2]), att, &tmp);
zend_hash_update(Z_ARRVAL(args[2]), att, &tmp);
attributes += 2;
@@ -688,7 +688,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha
val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding);
ZVAL_STR(&tmp, val);
zend_symtable_update(Z_ARRVAL(atr), att, &tmp);
zend_hash_update(Z_ARRVAL(atr), att, &tmp);
atcnt++;
attributes += 2;