Fix example for custom distribution strategy.

See ISSUE #63 for details.
This commit is contained in:
Daniele Alessandri
2012-04-13 11:37:03 +02:00
parent 6b6c91cd15
commit 9426d78b90
+2 -2
View File
@@ -23,7 +23,7 @@ class NaiveDistributionStrategy implements DistributionStrategyInterface
private $nodes;
private $nodesCount;
public function __constructor()
public function __construct()
{
$this->nodes = array();
$this->nodesCount = 0;
@@ -51,7 +51,7 @@ class NaiveDistributionStrategy implements DistributionStrategyInterface
throw new RuntimeException('No connections');
}
return $this->nodes[$count > 1 ? abs(crc32($key) % $count) : 0];
return $this->nodes[$count > 1 ? abs($key % $count) : 0];
}
public function hash($value)