We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7acd49d commit b875a4fCopy full SHA for b875a4f
1 file changed
src/Lib/Configuration.php
@@ -90,7 +90,7 @@ public function __construct(array $config)
90
91
$this->randomizeNodes = $config['randomize_nodes'] ?? true;
92
if ($this->randomizeNodes) {
93
- $this->shuffleNodes();
+ shuffle($this->nodes);
94
}
95
96
$nearestNode = $config['nearest_node'] ?? null;
@@ -247,18 +247,4 @@ public function getClient(): ClientInterface | HttpMethodsClient
247
248
return $this->client;
249
250
-
251
- /**
252
- * Shuffles the nodes array using Fisher-Yates algorithm
253
- */
254
- private function shuffleNodes(): void
255
- {
256
- $count = count($this->nodes);
257
- for ($i = $count - 1; $i > 0; $i--) {
258
- $j = random_int(0, $i);
259
- $temp = $this->nodes[$i];
260
- $this->nodes[$i] = $this->nodes[$j];
261
- $this->nodes[$j] = $temp;
262
- }
263
264
0 commit comments