Oran Agra 11fe272c1a Optimize HRANDFIELD and ZRANDMEMBER case 4 when ziplist encoded (#8444)
It is inefficient to repeatedly pick a single random element from a
ziplist.
For CASE4, which is when the user requested a low number of unique
random picks from the collectoin, we used thta pattern.

Now we use a different algorithm that picks unique elements from a
ziplist, and guarentee no duplicate but doesn't provide random order
(which is only needed in the non-unique random picks case)

Unrelated changes:
* change ziplist count and indexes variables to unsigned
* solve compilation warnings about uninitialized vars in gcc 10.2

Co-authored-by: xinluton <xinluton@qq.com>
2021-02-07 16:55:11 +02:00
..
2020-11-09 21:48:56 -08:00
2020-04-24 17:00:03 -07:00
2020-04-24 17:11:21 -07:00
2021-01-04 17:02:57 +02:00
2018-07-03 18:19:46 +02:00
2021-01-26 09:45:53 +08:00
2019-02-24 21:38:15 +01:00
2021-01-31 12:16:58 +02:00
2021-01-04 17:02:57 +02:00
2020-10-27 15:04:18 +02:00
2020-05-05 23:35:08 -04:00
2020-09-29 15:52:13 +03:00
2019-11-19 17:23:47 +08:00
2021-01-04 17:02:57 +02:00
2021-01-04 17:02:57 +02:00
2019-10-02 11:30:20 +02:00
2020-07-24 14:40:19 +08:00
2021-01-28 18:17:39 +02:00
2021-01-28 18:17:39 +02:00
2021-01-04 17:02:57 +02:00
2021-01-28 16:19:43 +02:00
2020-07-21 08:13:05 +03:00
2020-12-13 11:11:29 +02:00
2021-01-18 11:37:05 +02:00
2021-01-18 11:37:05 +02:00