This commit is contained in:
Anatoly Yakovenko
2018-05-16 23:17:45 -07:00
parent b04716d40d
commit 35ee2d0ce1

View File

@ -298,10 +298,10 @@ impl Crdt {
// max number of nodes that we could be converged to
pub fn convergence(&self) -> u64 {
let min = self.remote
let max = self.remote.values().len() as u64 + 1;
self.remote
.values()
.fold(std::u64::MAX, |a, b| std::cmp::min(a, *b));
std::cmp::min(min, self.remote.values().len() as u64 + 1)
.fold(max, |a, b| std::cmp::min(a, *b))
}
fn random() -> u64 {