Some commands accepting multiple keys can be hashed if all the keys return the same hash (key tags).

List of the commands affected by this change (based on Redis 2.2):
    MSET, MGET, DEL, BLPOP, BRPOP, RPOPLPUSH, BRPOPLPUSH, SINTER, SINTERSTORE,
    SUNION, SUNIONSTORE, SDIFF, SDIFFSTORE, ZINTERSTORE, ZUNIONSTORE.
This commit is contained in:
Daniele Alessandri
2011-03-27 12:12:51 +02:00
parent b84c84007f
commit c4064e5801
12 changed files with 59 additions and 7 deletions
+3 -1
View File
@@ -5,7 +5,9 @@ namespace Predis\Commands;
use Predis\Utils;
class SetIntersectionStore extends Command {
protected function canBeHashed() { return false; }
protected function canBeHashed() {
return $this->checkSameHashForKeys($this->getArguments());
}
public function getId() { return 'SINTERSTORE'; }
public function filterArguments(Array $arguments) {
return Utils::filterArrayArguments($arguments);