Skip to content

Commit abe2d2e

Browse files
committed
ext/xmlwriter: Use new php_streams fast ZPP specifier
1 parent c1666f8 commit abe2d2e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

ext/xmlwriter/php_xmlwriter.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -974,24 +974,18 @@ static int xml_writer_stream_close(void *context)
974974

975975
PHP_METHOD(XMLWriter, toStream)
976976
{
977-
zval *stream_zv;
978977
php_stream *stream;
979978

980979
ZEND_PARSE_PARAMETERS_START(1, 1)
981-
Z_PARAM_RESOURCE(stream_zv)
980+
PHP_Z_PARAM_STREAM(stream)
982981
ZEND_PARSE_PARAMETERS_END();
983982

984-
php_stream_from_res(stream, Z_RES_P(stream_zv));
985-
986983
xmlOutputBufferPtr output_buffer = xmlOutputBufferCreateIO(xml_writer_stream_write, xml_writer_stream_close, stream->res, NULL);
987984
if (UNEXPECTED(output_buffer == NULL)) {
988985
zend_throw_error(NULL, "Could not construct libxml output buffer");
989986
RETURN_THROWS();
990987
}
991988

992-
/* When the buffer is closed (even in error paths) the reference is destroyed. */
993-
Z_ADDREF_P(stream_zv);
994-
995989
xmlTextWriterPtr writer = xmlNewTextWriter(output_buffer);
996990
if (UNEXPECTED(writer == NULL)) {
997991
xmlOutputBufferClose(output_buffer);

0 commit comments

Comments
 (0)