Skip to content

Commit

Permalink
Merge pull request #47 from JayKickliter/jsk/remove-ood-comments
Browse files Browse the repository at this point in the history
remove out of date comment
  • Loading branch information
JayKickliter authored Sep 25, 2024
2 parents 6989258 + 5369ab5 commit 6a6d0ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
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

0 comments on commit 6a6d0ba

Please sign in to comment.