Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove out of date comment #47

Merged
merged 2 commits into from
Sep 25, 2024
Merged
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
9 changes: 7 additions & 2 deletions src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,13 @@ impl Cell {
#[inline]
pub fn is_related_to(&self, other: &Self) -> bool {
let common_res = std::cmp::min(self.res(), other.res());
// Unwrap is fine. We already checked to the min common resolution.
self.to_parent(common_res).unwrap() == other.to_parent(common_res).unwrap()
let promoted_self = self
.to_parent(common_res)
.expect("we already checked to the min common resolution");
let promoted_other = other
.to_parent(common_res)
.expect("we already checked to the min common resolution");
promoted_self == promoted_other
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ where
}) => cell_value,
Entry::Vacant(VacantEntry { target_cell, map }) => {
map.insert(target_cell, Default::default());
// We just inserted; unwrap is fine.
map.get_mut(target_cell).unwrap()
map.get_mut(target_cell).expect("we just inserted")
}
}
}
Expand Down
7 changes: 0 additions & 7 deletions src/node.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
use crate::{compaction::Compactor, digits::Digits, Cell};

// TODO: storing indices in nodes is not necessary, since the index
// can always be derived by the path through the tree to get to the
// node. That said, storing the index doesn't impose much lookup
// overhead.
//
// The benefit of storing indices is vastly simpler Cell+Value
// iteration of a tree.
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(align(64))]
Expand Down
Loading