Minor speed optimizations.

This commit is contained in:
Daniele Alessandri
2011-03-23 23:27:05 +01:00
parent 930a1096e1
commit 4e0e1908cd
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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])) {
+5 -5
View File
@@ -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) {