Skip to content

Commit fefa65a

Browse files
committed
ext/hash: Use new php_streams fast ZPP specifier
1 parent f9672b8 commit fefa65a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ext/hash/hash.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,18 +707,20 @@ PHP_FUNCTION(hash_update)
707707
/* {{{ Pump data into the hashing algorithm from an open stream */
708708
PHP_FUNCTION(hash_update_stream)
709709
{
710-
zval *zhash, *zstream;
710+
zend_object *hash_obj;
711711
php_hashcontext_object *hash;
712712
php_stream *stream = NULL;
713713
zend_long length = -1, didread = 0;
714714

715-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Or|l", &zhash, php_hashcontext_ce, &zstream, &length) == FAILURE) {
716-
RETURN_THROWS();
717-
}
715+
ZEND_PARSE_PARAMETERS_START(2, 3)
716+
Z_PARAM_OBJ_OF_CLASS(hash_obj, php_hashcontext_ce)
717+
PHP_Z_PARAM_STREAM(stream)
718+
Z_PARAM_OPTIONAL
719+
Z_PARAM_LONG(length)
720+
ZEND_PARSE_PARAMETERS_END();
718721

719-
hash = php_hashcontext_from_object(Z_OBJ_P(zhash));
722+
hash = php_hashcontext_from_object(hash_obj);
720723
PHP_HASHCONTEXT_VERIFY(hash);
721-
php_stream_from_zval(stream, zstream);
722724

723725
while (length) {
724726
char buf[1024];

0 commit comments

Comments
 (0)