From: okazaki Date: Sat, 3 Jun 2000 12:13:24 +0000 (+0000) Subject: * elmo-localdir.el (elmo-localdir-msgdb-create-as-numlist): X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=86942613798bbe015c609d0e1818c32f3f778655;p=elisp%2Fwanderlust.git * elmo-localdir.el (elmo-localdir-msgdb-create-as-numlist): Initialize local variables with `let'. Inline a temporary variable for the progress percentage. Sort `setq' to reduce function call in the while-loop. --- diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index ff76b8c..d455262 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -118,9 +118,9 @@ (when numlist (let ((dir (elmo-localdir-get-folder-directory spec)) overview number-alist mark-alist entity message-id - i percent len num seen gmark) - (setq len (length numlist)) - (setq i 0) + num seen gmark + (i 0) + (len (length numlist))) (message "Creating msgdb...") (while numlist (setq entity @@ -132,12 +132,11 @@ (setq overview (elmo-msgdb-append-element overview entity)) - (setq number-alist - (elmo-msgdb-number-add number-alist - num - (elmo-msgdb-overview-entity-get-id - entity))) (setq message-id (elmo-msgdb-overview-entity-get-id entity)) + (setq number-alist + (elmo-msgdb-number-add number-alist + num + message-id)) (setq seen (member message-id seen-list)) (if (setq gmark (or (elmo-msgdb-global-mark-get message-id) (if (elmo-cache-exists-p message-id) ; XXX @@ -154,10 +153,9 @@ gmark)))) (when (> len elmo-display-progress-threshold) (setq i (1+ i)) - (setq percent (/ (* i 100) len)) (elmo-display-progress 'elmo-localdir-msgdb-create-as-numlist "Creating msgdb..." - percent)) + (/ (* i 100) len))) (setq numlist (cdr numlist))) (message "Creating msgdb...done.") (list overview number-alist mark-alist))))