mirror of
https://github.com/predis/predis.git
synced 2026-08-30 20:21:31 +00:00
Fix example for custom distribution strategy.
See ISSUE #63 for details.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user