antirez/redis — pull request #1803 by advance512 (2014-06-10 16:01:16+00:00)
Title: SPOP optional count argument. (issue #1793)

More details of implementation in issue https://github.com/antirez/redis/issues/1793.

---

Commit message:

Added parameter to SPOP:
* spopCommand() now runs spopWithCountCommand() in case the param is found.
* Added intsetRandomMembers() to Intset: Copies N random members from the set into inputted 'values' array. Uses either the Knuth or Floyd sample algos depending on ratio count/size.
* Added setTypeRandomElements() to SET type: Returns a number of random elements from a non empty set. This is a version of setTypeRandomElement() that is modified in order to return multiple entries, using dictGetRandomKeys() and intsetRandomMembers().
* Added tests for SPOP with : unit/type/set, unit/scripting, integration/aof