File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed
Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public function __construct(array $config)
9090
9191 $ this ->randomizeNodes = $ config ['randomize_nodes ' ] ?? true ;
9292 if ($ this ->randomizeNodes ) {
93- $ this ->shuffleNodes ( );
93+ shuffle ( $ this ->nodes );
9494 }
9595
9696 $ nearestNode = $ config ['nearest_node ' ] ?? null ;
@@ -247,18 +247,4 @@ public function getClient(): ClientInterface | HttpMethodsClient
247247 }
248248 return $ this ->client ;
249249 }
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- }
264250}
You can’t perform that action at this time.
0 commit comments