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:
edef 2025-05-01 15:02:04 +00:00
parent 0e32b4d72d
commit 94ba112360

View file

@ -803,11 +803,8 @@ mod pure_builtins {
let mut left = left_keys.next().unwrap(); let mut left = left_keys.next().unwrap();
let mut right = right_keys.next().unwrap(); let mut right = right_keys.next().unwrap();
// Calculate the intersection of the attribute sets by simultaneously // Calculate the intersection of two attribute sets by iterating them
// advancing two key iterators, and inserting into the result set from // simultaneously in lexicographic order, similar to a merge sort.
// 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.
// //
// Only when keys match are the key and value clones actually allocated. // Only when keys match are the key and value clones actually allocated.
// //