summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/avl-tree.el
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2007-08-27 01:35:41 +0000
committerThien-Thi Nguyen <ttn@gnuvola.org>2007-08-27 01:35:41 +0000
commit25e32569d41466ef97acf433a062c5d02a3601cf (patch)
treec0a074df0047a7083abc19bdc42be59a7e4b00a5 /lisp/emacs-lisp/avl-tree.el
parentfb5da2db3e0b8d52337682ce59f397a5ae88869f (diff)
downloademacs-25e32569d41466ef97acf433a062c5d02a3601cf.tar.gz
Don't require `cl'.
(elib-stack-create, elib-stack-push, elib-stack-pop): Delete funcs. (elib-avl-mapc): Use `nil' for new stack, and `push' and `pop' directly.
Diffstat (limited to 'lisp/emacs-lisp/avl-tree.el')
-rw-r--r--lisp/emacs-lisp/avl-tree.el13
1 files changed, 4 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el
index 604147f618e..b68ebc47de3 100644
--- a/lisp/emacs-lisp/avl-tree.el
+++ b/lisp/emacs-lisp/avl-tree.el
@@ -97,11 +97,6 @@
;; NEWVAL is new value of the branch."
(` (aset (, node) (, branch) (, newval))))
-(eval-when-compile (require 'cl))
-(defun elib-stack-create () (list))
-(defmacro elib-stack-push (stack object) `(push ,object ,stack))
-(defmacro elib-stack-pop (stack) `(pop ,stack))
-
;;; ================================================================
;;; Functions and macros handling an AVL tree node.
@@ -413,15 +408,15 @@
;; Note: MAP-FUNCTION is applied to the node and not to the data itself.
;; INTERNAL USE ONLY.
(let ((node root)
- (stack (elib-stack-create))
+ (stack nil)
(go-left t))
- (elib-stack-push stack nil)
+ (push nil stack)
(while node
(if (and go-left
(elib-node-left node))
;; Do the left subtree first.
(progn
- (elib-stack-push stack node)
+ (push node stack)
(setq node (elib-node-left node)))
;; Apply the function...
(funcall map-function node)
@@ -429,7 +424,7 @@
(if (elib-node-right node)
(setq node (elib-node-right node)
go-left t)
- (setq node (elib-stack-pop stack)
+ (setq node (pop stack)
go-left nil))))))
(defun elib-avl-do-copy (root)