mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-11 06:42:21 +00:00
fix: tree child container index (#284)
This commit is contained in:
parent
71addcb6de
commit
da782c7659
1 changed files with 7 additions and 2 deletions
|
@ -338,10 +338,15 @@ impl ContainerState for TreeState {
|
|||
/// Get the index of the child container
|
||||
fn get_child_index(&self, id: &ContainerID) -> Option<Index> {
|
||||
let id = id.as_normal().unwrap();
|
||||
Some(Index::Node(TreeID {
|
||||
let tree_id = TreeID {
|
||||
peer: *id.0,
|
||||
counter: *id.1,
|
||||
}))
|
||||
};
|
||||
if !self.trees.contains_key(&tree_id) || self.is_node_deleted(&tree_id) {
|
||||
None
|
||||
} else {
|
||||
Some(Index::Node(tree_id))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_child_containers(&self) -> Vec<ContainerID> {
|
||||
|
|
Loading…
Reference in a new issue