docs(snix/eval/intersectAttrs): simplify algorithm description
It's literally just an intersecting merge sort. Change-Id: Icc59928091c48130a4616476fc103ef33aee21e4 Reviewed-on: https://cl.snix.dev/c/snix/+/30374 Reviewed-by: Florian Klink <flokli@flokli.de> Tested-by: besadii
This commit is contained in:
parent
0e32b4d72d
commit
94ba112360
1 changed files with 2 additions and 5 deletions
|
|
@ -803,11 +803,8 @@ mod pure_builtins {
|
|||
let mut left = left_keys.next().unwrap();
|
||||
let mut right = right_keys.next().unwrap();
|
||||
|
||||
// Calculate the intersection of the attribute sets by simultaneously
|
||||
// advancing two key iterators, and inserting into the result set from
|
||||
// the right side when the keys match. Iteration over Nix attribute sets
|
||||
// is in sorted lexicographical order, so we can advance either iterator
|
||||
// until it "catches up" with its counterpart.
|
||||
// Calculate the intersection of two attribute sets by iterating them
|
||||
// simultaneously in lexicographic order, similar to a merge sort.
|
||||
//
|
||||
// Only when keys match are the key and value clones actually allocated.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue