Minor change (mostly micro-optimization).

This commit is contained in:
Daniele Alessandri
2012-08-02 12:42:53 +02:00
parent 1ac9cc9c71
commit 69d4c013f7
2 changed files with 6 additions and 2 deletions
@@ -311,7 +311,9 @@ class PredisClusterHashStrategy implements CommandHashStrategyInterface
$hash = $command->getHash();
if (!isset($hash) && isset($this->commands[$cmdID = $command->getId()])) {
if ($key = call_user_func($this->commands[$cmdID], $command)) {
$key = call_user_func($this->commands[$cmdID], $command);
if (isset($key)) {
$hash = $this->getKeyHash($key);
$command->setHash($hash);
}
@@ -263,7 +263,9 @@ class RedisClusterHashStrategy implements CommandHashStrategyInterface
$hash = $command->getHash();
if (!isset($hash) && isset($this->commands[$cmdID = $command->getId()])) {
if (null !== $key = call_user_func($this->commands[$cmdID], $command)) {
$key = call_user_func($this->commands[$cmdID], $command);
if (isset($key)) {
$hash = $this->hashGenerator->hash($key);
$command->setHash($hash);
}