Function: radix-tree-iter-subtrees

radix-tree-iter-subtrees is a byte-compiled function defined in radix-tree.el.gz.

Signature

(radix-tree-iter-subtrees TREE FUN)

Documentation

Apply FUN to every immediate subtree of radix TREE.

FUN is called with two arguments: PREFIX and SUBTREE. You can test if SUBTREE is a leaf (and extract its value) with the pcase pattern (radix-tree-leaf PAT).

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/radix-tree.el.gz
(defun radix-tree-iter-subtrees (tree fun)
  "Apply FUN to every immediate subtree of radix TREE.
FUN is called with two arguments: PREFIX and SUBTREE.
You can test if SUBTREE is a leaf (and extract its value) with the
pcase pattern (radix-tree-leaf PAT)."
  (while tree
    (pcase tree
      (`((,prefix . ,ptree) . ,rtree)
       (funcall fun prefix ptree)
       (setq tree rtree))
      (_ (funcall fun "" tree)
         (setq tree nil)))))