dovecot-1.0: Small code optimization.
dovecot at dovecot.org
dovecot at dovecot.org
Sun Sep 23 14:27:02 EEST 2007
details: http://hg.dovecot.org/dovecot-1.0/rev/678626efb942
changeset: 5418:678626efb942
user: Timo Sirainen <tss at iki.fi>
date: Sun Sep 23 14:26:58 2007 +0300
description:
Small code optimization.
diffstat:
1 file changed, 6 insertions(+), 10 deletions(-)
src/lib-storage/index/index-search.c | 16 ++++++----------
diffs (26 lines):
diff -r 92b2bd6b6c2d -r 678626efb942 src/lib-storage/index/index-search.c
--- a/src/lib-storage/index/index-search.c Sun Sep 23 14:21:54 2007 +0300
+++ b/src/lib-storage/index/index-search.c Sun Sep 23 14:26:58 2007 +0300
@@ -854,16 +854,12 @@ static void search_args_fix_subs(struct
struct mail_search_arg *sub;
for (; args != NULL;) {
- if (args->not && args->type == SEARCH_SUB) {
- /* neg(p and q and ..) == neg(p) or neg(q) or .. */
- args->type = SEARCH_OR;
- args->not = FALSE;
- sub = args->value.subargs;
- for (; sub != NULL; sub = sub->next)
- sub->not = !sub->not;
- } else if (args->not && args->type == SEARCH_OR) {
- /* neg(p or q or ..) == neg(p) and neg(q) and .. */
- args->type = SEARCH_SUB;
+ if (args->not && (args->type == SEARCH_SUB ||
+ args->type == SEARCH_OR)) {
+ /* neg(p and q and ..) == neg(p) or neg(q) or ..
+ neg(p or q or ..) == neg(p) and neg(q) and .. */
+ args->type = args->type == SEARCH_SUB ?
+ SEARCH_OR : SEARCH_SUB;
args->not = FALSE;
sub = args->value.subargs;
for (; sub != NULL; sub = sub->next)
More information about the dovecot-cvs
mailing list