From: hmurata Date: Sat, 6 Dec 2003 01:14:39 +0000 (+0000) Subject: * elmo.el (elmo-folder-set-info-max-by-numdb): Don't use `sort' to X-Git-Tag: wl-2_11_23~24 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fa30e2a29ed9d04c3267d1b26a0d2fe52f01819;p=elisp%2Fwanderlust.git * elmo.el (elmo-folder-set-info-max-by-numdb): Don't use `sort' to get max number. (elmo-generic-folder-diff): Ditto. * elmo-nntp.el (elmo-nntp-catchup-msgdb): Ditto. (elmo-folder-update-number): Ditto. * elmo-dop.el (elmo-folder-status-dop): Ditto. (elmo-folder-next-message-number-dop): Ditto. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 2b38ff9..dae5dbd 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,15 @@ +2003-12-06 Hiroya Murata + + * elmo.el (elmo-folder-set-info-max-by-numdb): Don't use `sort' to + get max number. + (elmo-generic-folder-diff): Ditto. + + * elmo-nntp.el (elmo-nntp-catchup-msgdb): Ditto. + (elmo-folder-update-number): Ditto. + + * elmo-dop.el (elmo-folder-status-dop): Ditto. + (elmo-folder-next-message-number-dop): Ditto. + 2003-12-04 Hiroya Murata * elmo-filter.el (elmo-folder-msgdb-create): Use diff --git a/elmo/elmo-dop.el b/elmo/elmo-dop.el index 9309c16..17faa0f 100644 --- a/elmo/elmo-dop.el +++ b/elmo/elmo-dop.el @@ -286,25 +286,25 @@ FOLDER is the folder structure." ;;; Execute as subsutitute for plugged operation. (defun elmo-folder-status-dop (folder) - (let ((number-list (sort (elmo-folder-list-messages folder nil 'in-msgdb) '>)) + (let ((number-list (elmo-folder-list-messages folder nil 'in-msgdb)) (spool-folder (elmo-dop-spool-folder folder)) spool-length max-num) (setq spool-length (or (if (elmo-folder-exists-p spool-folder) (car (elmo-folder-status spool-folder))) 0)) - (setq max-num (or (car number-list) 0)) + (setq max-num (if number-list (apply #'max number-list) 0)) (cons (+ max-num spool-length) (+ (length number-list) spool-length)))) (defun elmo-folder-next-message-number-dop (folder) - (let ((number-list (sort (elmo-folder-list-messages folder nil 'in-msgdb) '>)) + (let ((number-list (elmo-folder-list-messages folder nil 'in-msgdb)) (spool-folder (elmo-dop-spool-folder folder)) spool-length max-num) (setq spool-length (or (if (elmo-folder-exists-p spool-folder) (car (elmo-folder-status spool-folder))) 0)) - (setq max-num (or (car number-list) 0)) + (setq max-num (if number-list (apply #'max number-list) 0)) (+ max-num spool-length))) ;;; Delayed operation (executed at online status). diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index 1cf8b80..1df515a 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -465,9 +465,7 @@ Don't cache if nil.") (defsubst elmo-nntp-catchup-msgdb (msgdb max-number) (let ((numbers (elmo-msgdb-list-messages msgdb)) msgdb-max) - (setq msgdb-max (if numbers - (car (sort numbers '>)) - 0)) + (setq msgdb-max (if numbers (apply #'max numbers) 0)) (when (and msgdb-max max-number (< msgdb-max max-number)) @@ -901,9 +899,7 @@ Don't cache if nil.") (setq max-number (nth 1 (read (concat "(" (elmo-nntp-read-contents session) ")")))) - (setq msgdb-max (if numbers - (car (sort numbers '>)) - 0)) + (setq msgdb-max (if numbers (apply #'max numbers) 0)) (when (and msgdb-max max-number (< msgdb-max max-number)) diff --git a/elmo/elmo.el b/elmo/elmo.el index fd51b6f..7a845e0 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -850,7 +850,7 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-FLAG-ALIST).") "Set FOLDER info by MSGDB-NUMBER in msgdb." (elmo-folder-set-info-hashtb folder - (or (car (sort numbers '>)) 0) + (if numbers (apply #'max numbers) 0) nil ;;(length num-db) )) @@ -929,9 +929,8 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-FLAG-ALIST).") (let ((number-list (elmo-folder-list-messages folder nil 'in-msgdb))) ;; No info-cache. - (setq in-db (sort number-list '<)) - (setq in-db-max (or (nth (max 0 (1- (length in-db))) in-db) - 0)) + (setq in-db number-list) + (setq in-db-max (if in-db (apply #'max in-db) 0)) (elmo-folder-set-info-hashtb folder in-db-max nil)) (setq in-db-max cached-in-db-max)) (setq unsync (if (and in-db (car in-folder))