dovecot-1.0: Merge also unnecessary sub-ORs.

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 23 14:21:59 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/92b2bd6b6c2d
changeset: 5417:92b2bd6b6c2d
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 23 14:21:54 2007 +0300
description:
Merge also unnecessary sub-ORs.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/lib-storage/index/index-search.c |    6 ++++--

diffs (16 lines):

diff -r fa89431f893e -r 92b2bd6b6c2d src/lib-storage/index/index-search.c
--- a/src/lib-storage/index/index-search.c	Sun Sep 23 14:16:11 2007 +0300
+++ b/src/lib-storage/index/index-search.c	Sun Sep 23 14:21:54 2007 +0300
@@ -870,8 +870,10 @@ static void search_args_fix_subs(struct 
 				sub->not = !sub->not;
 		}
 
-		if (args->type == SEARCH_SUB && parent_and) {
-			/* p and (q and ..) == p and q and .. */
+		if ((args->type == SEARCH_SUB && parent_and) ||
+		    (args->type == SEARCH_OR && !parent_and)) {
+			/* p and (q and ..) == p and q and ..
+			   p or (q or ..) == p or q or .. */
 			sub = args->value.subargs;
 			for (; sub->next != NULL; sub = sub->next) ;
 			sub->next = args->next;


More information about the dovecot-cvs mailing list