mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
b9a0500f16
New commands: `HRANDFIELD [<count> [WITHVALUES]]` `ZRANDMEMBER [<count> [WITHSCORES]]` Algorithms are similar to the one in SRANDMEMBER. Both return a simple bulk response when no arguments are given, and an array otherwise. In case values/scores are requested, RESP2 returns a long array, and RESP3 a nested array. note: in all 3 commands, the only option that also provides random order is the one with negative count. Changes to SRANDMEMBER * Optimization when count is 1, we can use the more efficient algorithm of non-unique random * optimization: work with sds strings rather than robj Other changes: * zzlGetScore: when zset needs to convert string to double, we use safer memcpy (in case the buffer is too small) * Solve a "bug" in SRANDMEMBER test: it intended to test a positive count (case 3 or case 4) and by accident used a negative count Co-authored-by: xinluton <xinluton@qq.com> Co-authored-by: Oran Agra <oran@redislabs.com> |
||
---|---|---|
.. | ||
hash.tcl | ||
incr.tcl | ||
list-2.tcl | ||
list-3.tcl | ||
list-common.tcl | ||
list.tcl | ||
set.tcl | ||
stream-cgroups.tcl | ||
stream.tcl | ||
string.tcl | ||
zset.tcl |