t_set.c comment update for srandmemberWithCountCommand (#7922)

Reference the correct "case", case 4, in the comment explaining the need
for case 3, when the number of request items is too close to the
cardinality of the set. Case 4 is indeed the "natural approach"
referenced earlier in that sentence.
This commit is contained in:
Pierre Jambet 2020-10-18 01:14:45 -04:00 committed by GitHub
parent 786d6d55cf
commit f6010e106b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -694,7 +694,7 @@ void srandmemberWithCountCommand(client *c) {
* *
* This is done because if the number of requested elements is just * This is done because if the number of requested elements is just
* a bit less than the number of elements in the set, the natural approach * a bit less than the number of elements in the set, the natural approach
* used into CASE 3 is highly inefficient. */ * used into CASE 4 is highly inefficient. */
if (count*SRANDMEMBER_SUB_STRATEGY_MUL > size) { if (count*SRANDMEMBER_SUB_STRATEGY_MUL > size) {
setTypeIterator *si; setTypeIterator *si;