def AaAttach.best

bend-osdev-apparmor@0.1.0.0 · transitions.bend:125

import bend-osdev-apparmor@0.1.0.0/transitions.bend as Transitions
import Base
import bend-osdev-apparmor@0.1.0.0/profile.bend as PR

125# the profile of the list whose attachment best matches the path; prefix:
126# the full name of the parent, for children
127def AaAttach.best(ps: List<&2, PR.AaProfile>, +path: List<&2, U32>, +prefix: List<&2, U32>, +best: AaAttach) -> AaAttach:
128  match ps:
129    case Nil{}:
130      best
131    case Con{+p, t}:
132      AaAttach.best(t, path, prefix, AaAttach.better(best, AaAttach.rank_of(PR.AaProfile.attach(p), path), AaAttach.join(prefix, PR.AaProfile.name(p))))

Uses (9)

Used by (3)