MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / contains

Method contains

atomic-core/src/pristine/span_patch_storage.rs:616–630  ·  view source on GitHub ↗
(&self, descendant: NodeId, ancestor: NodeId)

Source from the content-addressed store, hash-verified

614 }
615
616 fn contains(&self, descendant: NodeId, ancestor: NodeId) -> Option<bool> {
617 let d = self
618 .ranks
619 .binary_search_by_key(&descendant.get(), |(id, _)| id.get())
620 .ok()?;
621 let a = self
622 .ranks
623 .binary_search_by_key(&ancestor.get(), |(id, _)| id.get())
624 .ok()?;
625 if descendant == ancestor {
626 return Some(false);
627 }
628 let (d, a) = (self.ranks[d].1, self.ranks[a].1);
629 Some(self.bits[d * self.words + a / 64] & (1u64 << (a % 64)) != 0)
630 }
631}
632
633/// Validated span content shared by file renders in one read transaction.

Callers 7

semantic_baseline_idMethod · 0.45
render_if_visibleMethod · 0.45
record_stateMethod · 0.45
render_internalMethod · 0.45
depends_onMethod · 0.45
frameMethod · 0.45

Calls 2

getMethod · 0.65
okMethod · 0.45