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

Function folder_edge_source_fits

atomic-core/src/apply/edge.rs:357–359  ·  view source on GitHub ↗

Whether `source` can be the origin of a FOLDER edge into `target`. The folder graph alternates between zero-length markers (the root and every inode) and non-empty name vertices: a marker names its children and a name vertex points at its inode. Edges record only the target's start position, and an empty file's inode marker starts exactly where its next sibling's name vertex starts, so a position

(source: GraphNode<NodeId>, target: GraphNode<NodeId>)

Source from the content-addressed store, hash-verified

355/// marker to the sibling also matches the empty file's name vertex. The
356/// alternation tells the two apart: into a name vertex only a marker fits.
357fn folder_edge_source_fits(source: GraphNode<NodeId>, target: GraphNode<NodeId>) -> bool {
358 source.is_empty() != target.is_empty()
359}
360
361fn source_has_exact_edge(
362 txn: &CachedWriteGraphTxn<'_, '_>,

Callers 1

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected