* elmo-localdir.el (elmo-localdir-msgdb-create-as-numlist):
authorokazaki <okazaki>
Sat, 3 Jun 2000 12:13:24 +0000 (12:13 +0000)
committerokazaki <okazaki>
Sat, 3 Jun 2000 12:13:24 +0000 (12:13 +0000)
Initialize local variables with `let'.  Inline a temporary
variable for the progress percentage.  Sort `setq' to reduce
function call in the while-loop.

elmo/elmo-localdir.el

index ff76b8c..d455262 100644 (file)
   (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
          (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
                     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))))