mirror of
https://github.com/predis/predis.git
synced 2026-08-19 18:22:06 +00:00
Minor speed optimizations.
This commit is contained in:
@@ -27,7 +27,7 @@ abstract class Command implements ICommand {
|
||||
if (isset($this->_hash)) {
|
||||
return $this->_hash;
|
||||
}
|
||||
if ($this->canBeHashed() === false) {
|
||||
if (!$this->canBeHashed()) {
|
||||
return null;
|
||||
}
|
||||
if (!isset($this->_arguments[0])) {
|
||||
|
||||
@@ -48,12 +48,12 @@ class ConnectionCluster implements IConnectionCluster, \IteratorAggregate {
|
||||
|
||||
public function getConnection(ICommand $command) {
|
||||
$cmdHash = $command->getHash($this->_distributor);
|
||||
if (isset($cmdHash) === false) {
|
||||
throw new ClientException(
|
||||
sprintf("Cannot send '%s' commands to a cluster of connections", $command->getId())
|
||||
);
|
||||
if (isset($cmdHash)) {
|
||||
return $this->_distributor->get($cmdHash);
|
||||
}
|
||||
return $this->_distributor->get($cmdHash);
|
||||
throw new ClientException(
|
||||
sprintf("Cannot send '%s' commands to a cluster of connections", $command->getId())
|
||||
);
|
||||
}
|
||||
|
||||
public function getConnectionById($id = null) {
|
||||
|
||||
Reference in New Issue
Block a user