refactor: rm next lamport from app state diff

This commit is contained in:
Zixuan Chen 2023-07-12 21:29:21 +08:00
parent 6d2d28a721
commit 097d86915a
2 changed files with 1 additions and 12 deletions

View file

@ -65,7 +65,6 @@ impl LoroApp {
state.apply_diff(AppStateDiff {
diff: &diff,
frontiers: oplog.frontiers(),
next_lamport: oplog.latest_lamport + 1,
});
}
@ -109,7 +108,6 @@ impl LoroApp {
state.apply_diff(AppStateDiff {
diff: &diff,
frontiers: oplog.frontiers(),
next_lamport: oplog.latest_lamport + 1,
});
}

View file

@ -4,7 +4,6 @@ use fxhash::{FxHashMap, FxHashSet};
use ring::rand::SystemRandom;
use crate::{
change::Lamport,
configure::SecureRandomGenerator,
container::{registry::ContainerIdx, ContainerIdRaw},
event::Diff,
@ -84,7 +83,6 @@ pub struct ContainerStateDiff {
pub struct AppStateDiff<'a> {
pub(crate) diff: &'a [ContainerStateDiff],
pub(crate) frontiers: &'a Frontiers,
pub(crate) next_lamport: Lamport,
}
impl AppState {
@ -106,14 +104,7 @@ impl AppState {
self.peer = peer;
}
pub fn apply_diff(
&mut self,
AppStateDiff {
diff,
frontiers,
next_lamport,
}: AppStateDiff,
) {
pub fn apply_diff(&mut self, AppStateDiff { diff, frontiers }: AppStateDiff) {
if self.in_txn {
panic!("apply_diff should not be called in a transaction");
}