From d0492ce52e583ad95c3b902bb334fe5268002d26 Mon Sep 17 00:00:00 2001 From: hmurata Date: Mon, 28 Mar 2005 10:54:51 +0000 Subject: [PATCH] (elmo-condition-optimize): Discriminated against preserved fields, extra fields and the other weight. --- elmo/ChangeLog | 5 +++++ elmo/elmo-util.el | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) 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)))) -- 1.7.10.4