diff options
Diffstat (limited to 'lisp/emacs-lisp/radix-tree.el')
-rw-r--r-- | lisp/emacs-lisp/radix-tree.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/radix-tree.el b/lisp/emacs-lisp/radix-tree.el index 519087ca3e7..dd65e1a0b4e 100644 --- a/lisp/emacs-lisp/radix-tree.el +++ b/lisp/emacs-lisp/radix-tree.el @@ -74,7 +74,7 @@ (cmp (compare-strings prefix nil nil key i ni))) (if (eq t cmp) (pcase (radix-tree--remove ptree key ni) - (`nil rtree) + ('nil rtree) (`((,pprefix . ,pptree)) `((,(concat prefix pprefix) . ,pptree) . ,rtree)) (nptree `((,prefix . ,nptree) . ,rtree))) @@ -196,8 +196,8 @@ If not found, return nil." (eval-and-compile (pcase-defmacro radix-tree-leaf (vpat) - "Build a `pcase' pattern that matches radix-tree leaf EXPVAL. -VPAT is a `pcase' pattern to extract the value." + "Pattern which matches a radix-tree leaf. +The pattern VPAT is matched against the leaf's carried value." ;; FIXME: We'd like to use a negative pattern (not consp), but pcase ;; doesn't support it. Using `atom' works but generates sub-optimal code. `(or `(t . ,,vpat) (and (pred atom) ,vpat)))) @@ -237,6 +237,8 @@ PREFIX is only used internally." (radix-tree-iter-mappings tree (lambda (_k _v) (setq i (1+ i)))) i)) +(declare-function map-apply "map" (function map)) + (defun radix-tree-from-map (map) ;; Aka (cl-defmethod map-into (map (type (eql radix-tree)))) ...) (require 'map) |