Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 68 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/loro-internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ once_cell = { workspace = true }
arbitrary = { version = "1", optional = true }
postcard = { version = "1", default-features = false, features = ["use-std"] }
append-only-bytes = { version = "0.1.12", features = ["u32_range"] }
im = { version = "15.1.0", features = ["serde"] }
imbl = { version = "7.0.2", features = ["serde"] }
tabled = { version = "0.10.0", optional = true }
wasm-bindgen = { version = "=0.2.100", optional = true }
js-sys = { version = "0.3.60", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/loro-internal/src/dag/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(unused)]
use arbitrary::Arbitrary;
use im::HashSet;
use imbl::HashSet;
use loro_common::HasCounter;
use std::{cmp::Ordering, sync::Arc};

Expand Down
13 changes: 11 additions & 2 deletions crates/loro-internal/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ impl VersionRange {
/// can be created from cloning and modifying other similar version vectors.
#[repr(transparent)]
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ImVersionVector(im::HashMap<PeerID, Counter, rustc_hash::FxBuildHasher>);
pub struct ImVersionVector(
imbl::GenericHashMap<
PeerID,
Counter,
rustc_hash::FxBuildHasher,
imbl::shared_ptr::DefaultSharedPtr,
>,
);

#[inline]
fn normalize_vv_counter(counter: Counter) -> Counter {
Expand Down Expand Up @@ -197,7 +204,9 @@ impl ImVersionVector {
self.0.is_empty()
}

pub fn iter(&self) -> im::hashmap::Iter<'_, PeerID, Counter> {
pub fn iter(
&self,
) -> imbl::hashmap::Iter<'_, PeerID, Counter, imbl::shared_ptr::DefaultSharedPtr> {
self.0.iter()
}

Expand Down
Loading