pub fn intern_clip(clips: &mut Vec<Clip>, clip: Clip) -> u32Expand description
Interns a clip into a frame’s table and returns the index a quad names.
Only the last entry is compared, so this is a constant-time append with a run-length check and not a real intern: a clip that comes back after another one gets a second entry. That is deliberate. Emission runs in paint order, so equal clips arrive in runs, and the alternative — a scan of the whole table — is quadratic on the one frame shape that makes many clips (a screen of width-clamped labels, which narrows the clip once per label). A duplicate costs thirty-two bytes on a list that is orders of magnitude shorter than the quads; a quadratic scan costs the frame.
Callers avoid most of the calls entirely: a node whose clip is its
parent’s reuses the index the parent interned without comparing anything
(Core::emit_frame).