changeset 10795:8cbc8846b19b

(imenu--cleanup): Set alist to its default just once, at the beginning. Don't recurse on a cdr which is nil.
author Richard M. Stallman <rms@gnu.org>
date Wed, 22 Feb 1995 01:31:14 +0000
parents 4443f78a2117
children 546e4ae436be
files lisp/imenu.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/imenu.el	Wed Feb 22 01:30:19 1995 +0000
+++ b/lisp/imenu.el	Wed Feb 22 01:31:14 1995 +0000
@@ -488,16 +488,18 @@
   ;; Sets the markers in imenu--index-alist 
   ;; point nowhere.
   ;; if alist is provided use that list.
-  (and imenu--index-alist
+  (or alist
+      (setq alist imenu--index-alist))
+  (and alist
        (mapcar
 	(function
 	 (lambda (item)
 	   (cond
 	    ((markerp (cdr item))
 	     (set-marker (cdr item) nil))
-	    ((listp (cdr item))
+	    ((consp (cdr item))
 	     (imenu--cleanup (cdr item))))))
-	(if alist alist imenu--index-alist))
+	alist)
        t))
 
 (defun imenu-default-create-index-function ()