Function: avl-tree-map

avl-tree-map is a byte-compiled function defined in avl-tree.el.gz.

Signature

(avl-tree-map FUN TREE &optional REVERSE)

Documentation

Modify all elements in the AVL TREE by applying function FUN.

Each element is replaced by the return value of FUN applied to that element.

FUN is applied to the elements in ascending order, or descending order if REVERSE is non-nil.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/avl-tree.el.gz
(defun avl-tree-map (fun tree &optional reverse)
  "Modify all elements in the AVL TREE by applying function FUN.

Each element is replaced by the return value of FUN applied to
that element.

FUN is applied to the elements in ascending order, or descending
order if REVERSE is non-nil."
  (avl-tree--mapc
   (lambda (node)
     (setf (avl-tree--node-data node)
           (funcall fun (avl-tree--node-data node))))
   (avl-tree--root tree)
   (if reverse 1 0)))