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-06 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * 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 <lapis-lazuli@pop06.odn.ne.jp>
* elmo-filter.el (elmo-folder-msgdb-create): Use
;;; 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).
(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))
(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))
"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)
))
(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))