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
+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) {