+2002-01-20 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * elmo.el (elmo-folder-search-fast): Moved upwards rather than it
+ was used.
+
2002-01-19 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>
* elmo-util.el (elmo-save-buffer): The first argument of message
(elmo-folder-send folder 'elmo-folder-rename-internal new-folder)
(elmo-msgdb-rename-path folder new-folder)))
+(defsubst elmo-folder-search-fast (folder condition numbers)
+ (when (and numbers
+ (vectorp condition)
+ (member (elmo-filter-key condition) '("first" "last")))
+ (let ((len (length numbers))
+ (lastp (string= (elmo-filter-key condition) "last"))
+ (value (string-to-number (elmo-filter-value condition))))
+ (when (eq (elmo-filter-type condition) 'unmatch)
+ (setq lastp (not lastp)
+ value (- len value)))
+ (if lastp
+ (nthcdr (max (- len value) 0) numbers)
+ (when (> value 0)
+ (let ((last (nthcdr (1- value) numbers)))
+ (when last
+ (setcdr last nil))
+ numbers))))))
+
(luna-define-method elmo-folder-search ((folder elmo-folder)
condition
&optional numbers)
(elmo-progress-clear 'elmo-folder-search))
(nreverse matched)))))
-(defsubst elmo-folder-search-fast (folder condition numbers)
- (when (and numbers
- (vectorp condition)
- (member (elmo-filter-key condition) '("first" "last")))
- (let ((len (length numbers))
- (lastp (string= (elmo-filter-key condition) "last"))
- (value (string-to-number (elmo-filter-value condition))))
- (when (eq (elmo-filter-type condition) 'unmatch)
- (setq lastp (not lastp)
- value (- len value)))
- (if lastp
- (nthcdr (max (- len value) 0) numbers)
- (when (> value 0)
- (let ((last (nthcdr (1- value) numbers)))
- (when last
- (setcdr last nil))
- numbers))))))
-
(luna-define-method elmo-message-match-condition ((folder elmo-folder)
number condition
numbers)