crdt: Remove redundant `merge` function
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
d1360bbec0
commit
d18b67ba21
|
|
@ -1,6 +1,7 @@
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::ord::Max;
|
use crate::ord::Max;
|
||||||
|
use crate::Semilattice as _;
|
||||||
|
|
||||||
/// Lamport clock.
|
/// Lamport clock.
|
||||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,6 @@ impl<T> Max<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: PartialOrd> Max<T> {
|
|
||||||
pub fn merge(&mut self, other: Self) {
|
|
||||||
if other.0 > self.0 {
|
|
||||||
self.0 = other.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T: num_traits::SaturatingAdd + num_traits::One> Max<T> {
|
impl<T: num_traits::SaturatingAdd + num_traits::One> Max<T> {
|
||||||
pub fn incr(&mut self) {
|
pub fn incr(&mut self) {
|
||||||
self.0 = self.0.saturating_add(&T::one());
|
self.0 = self.0.saturating_add(&T::one());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue