From 03c3e0b0b835dd6b7c55dc00bd0765193ef993de Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Sat, 24 Aug 2024 15:05:38 +0800 Subject: [PATCH] refactor: rm arc in tree hist cache --- crates/loro-internal/src/history_cache.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/loro-internal/src/history_cache.rs b/crates/loro-internal/src/history_cache.rs index 11a4b3f6..c5012bd9 100644 --- a/crates/loro-internal/src/history_cache.rs +++ b/crates/loro-internal/src/history_cache.rs @@ -220,7 +220,7 @@ impl ContainerHistoryCache { } #[enum_dispatch(OpGroupTrait)] -#[derive(Debug, Clone, EnumAsInner)] +#[derive(Debug, EnumAsInner)] pub(crate) enum HistoryCacheForImporting { Tree(TreeOpGroup), } @@ -367,10 +367,10 @@ pub(crate) struct GroupedTreeOpInfo { pub(crate) value: Arc, } -#[derive(Debug, Clone, Default)] +#[derive(Debug, Default)] pub(crate) struct TreeOpGroup { ops: BTreeMap, - tree_for_diff: Arc>, + tree_for_diff: Mutex, } impl HistoryCacheTrait for TreeOpGroup { @@ -391,7 +391,7 @@ impl TreeOpGroup { &self.ops } - pub fn tree(&self) -> &Arc> { + pub fn tree(&self) -> &Mutex { &self.tree_for_diff } }