diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-30 18:04:07 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-02 10:06:16 +0100 |
commit | a6486088f8c98210b5676cd6fe337e205f6504b9 (patch) | |
tree | b7db8997ded34f9ca902d08cce735f230a20233b | |
parent | 7c787e56b02951aca09b65de81f0c194509e9b61 (diff) | |
download | php-git-a6486088f8c98210b5676cd6fe337e205f6504b9.tar.gz |
Switch hash() function to use fastzpp
For short inputs ZPP can be a large fraction of the hash()
execution time.
-rw-r--r-- | ext/hash/hash.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 3aedec6554..34dccfb32a 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -123,9 +123,12 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_ void *context; php_stream *stream = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ss|b", &algo, &data, &data_len, &raw_output) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_STR(algo) + Z_PARAM_STRING(data, data_len) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(raw_output) + ZEND_PARSE_PARAMETERS_END(); ops = php_hash_fetch_ops(algo); if (!ops) { |