mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-06 12:25:03 +00:00
refactor: rm next lamport from app state diff
This commit is contained in:
parent
6d2d28a721
commit
097d86915a
2 changed files with 1 additions and 12 deletions
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue