refactor(reflector): Improve candidate selection loop

This commit is contained in:
Nils Andreas Svee committed 2026-02-21 22:42:20 +07:00
1 parent 2aec477b89
commit 127ed692c3
1 file changed
+4 -1
+4 -1
View File
@@ -56,8 +56,11 @@ impl ReflectorSelector {
next_peers.push(*reflector); next_peers.push(*reflector);
} }
for _ in 1..20 { for _ in 0..20 {
let next_candidate = self.reflector_pool.choose(&mut rng).unwrap(); let next_candidate = self.reflector_pool.choose(&mut rng).unwrap();
if next_peers.contains(next_candidate) {
continue;
}
debug!("Next candidate: {}", next_candidate.to_string()); debug!("Next candidate: {}", next_candidate.to_string());
next_peers.push(*next_candidate); next_peers.push(*next_candidate);
} }