From: hmurata Date: Fri, 10 Feb 2006 12:42:47 +0000 (+0000) Subject: (elmo-flatten): Don't use recursive call. X-Git-Tag: wl-2_15_3~8 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=688fcf90ffbe0dfb01394cb40ee8840227416a79;p=elisp%2Fwanderlust.git (elmo-flatten): Don't use recursive call. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index fae09f3..81e79c1 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,7 @@ 2006-02-10 Hiroya Murata + * elmo-util.el (elmo-flatten): Don't use recursive call. + * elmo-search.el (elmo-folder-msgdb-create): Remove an unnecessary assignment. (elmo-folder-message-make-temp-files): Use `number-to-string' diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 70bfef7..7a60871 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1307,12 +1307,11 @@ SPEC is a list as followed (LABEL MAX-VALUE [FORMAT])." (defun elmo-flatten (list-of-list) "Flatten LIST-OF-LIST." - (unless (null list-of-list) - (append (if (and (car list-of-list) - (listp (car list-of-list))) - (car list-of-list) - (list (car list-of-list))) - (elmo-flatten (cdr list-of-list))))) + (if list-of-list + (apply #'nconc + (mapcar (lambda (element) + (if (consp element) element (list element))) + list-of-list)))) (defun elmo-y-or-n-p (prompt &optional auto default) "Same as `y-or-n-p'.