Skip to content

Commit da1a940

Browse files
committed
Set xmlreader property handler hash size to a precalculated value
1 parent 7f080d3 commit da1a940

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/xmlreader/php_xmlreader.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,8 @@ PHP_MINIT_FUNCTION(xmlreader)
11811181
prev_zend_post_startup_cb = zend_post_startup_cb;
11821182
zend_post_startup_cb = xmlreader_fixup_temporaries;
11831183

1184-
zend_hash_init(&xmlreader_prop_handlers, 0, NULL, NULL, true);
1184+
/* Note: update the size upon adding properties. */
1185+
zend_hash_init(&xmlreader_prop_handlers, 14, NULL, NULL, true);
11851186
XMLREADER_REGISTER_PROP_HANDLER(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG);
11861187
XMLREADER_REGISTER_PROP_HANDLER(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING);
11871188
XMLREADER_REGISTER_PROP_HANDLER(&xmlreader_prop_handlers, "depth", xmlTextReaderDepth, NULL, IS_LONG);

0 commit comments

Comments
 (0)