From: hmurata Date: Mon, 28 Mar 2005 10:54:51 +0000 (+0000) Subject: (elmo-condition-optimize): Discriminated against X-Git-Tag: wl-2_15_3~100 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d0492ce52e583ad95c3b902bb334fe5268002d26;p=elisp%2Fwanderlust.git (elmo-condition-optimize): Discriminated against preserved fields, extra fields and the other weight. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index c9b8102..df5c4dc 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2005-03-28 Hiroya Murata + + * elmo-util.el (elmo-condition-optimize): Discriminated against + preserved fields, extra fields and the other weight. + 2005-03-27 Hiroya Murata * modb-entity.el (initialize-instance): Define. diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 49b67a9..93497d0 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -305,12 +305,17 @@ Return value is a cons cell of (STRUCTURE . REST)" (defun elmo-condition-optimize (condition) (cond ((vectorp condition) - (or (cdr (assoc (elmo-filter-key condition) - '(("first" . 0) - ("last" . 0) - ("flag" . 1) - ("body" . 3)))) - 2)) + (let ((key (elmo-filter-key condition))) + (cond ((cdr (assoc key '(("first" . 0) + ("last" . 0) + ("flag" . 1) + ("body" . 5))))) + ((member key '("since" "before" "from" "subject" "to" "cc")) + 2) + ((member key elmo-msgdb-extra-fields) + 3) + (t + 4)))) (t (let ((weight-l (elmo-condition-optimize (nth 1 condition))) (weight-r (elmo-condition-optimize (nth 2 condition))))