[dovecot-cvs] dovecot/src/lib-storage/index index-search.c,1.71,1.72

cras at procontrol.fi cras at procontrol.fi
Tue Apr 22 22:35:49 EEST 2003


Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv10929/lib-storage/index

Modified Files:
	index-search.c 
Log Message:
More SEARCH OR fixes.



Index: index-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- index-search.c	22 Apr 2003 18:11:35 -0000	1.71
+++ index-search.c	22 Apr 2003 18:35:47 -0000	1.72
@@ -737,15 +737,15 @@
 static int search_get_sequid(struct index_mailbox *ibox,
 			     const struct mail_search_arg *args,
 			     unsigned int *first_seq, unsigned int *last_seq,
-			     unsigned int *first_uid, unsigned int *last_uid,
-			     int default_all)
+			     unsigned int *first_uid, unsigned int *last_uid)
 {
 	for (; args != NULL; args = args->next) {
-		if (args->type == SEARCH_OR || args->type == SEARCH_SUB) {
+		/* FIXME: we don't check if OR condition can limit the range.
+		   It's a bit tricky and unlikely to affect performance much. */
+		if (args->type == SEARCH_SUB) {
 			if (!search_get_sequid(ibox, args->value.subargs,
 					       first_seq, last_seq,
-					       first_uid, last_uid,
-					       args->type == SEARCH_OR))
+					       first_uid, last_uid))
 				return FALSE;
 		} else if (args->type == SEARCH_SET) {
 			if (!seq_update(args->value.str, first_seq, last_seq,
@@ -763,7 +763,7 @@
 						       args->value.str);
 				return FALSE;
 			}
-		} else if (args->type == SEARCH_ALL || default_all) {
+		} else if (args->type == SEARCH_ALL) {
 			/* go through everything */
 			*first_seq = 1;
 			*last_seq = ibox->synced_messages_count;
@@ -861,7 +861,7 @@
 	first_seq = last_seq = 0;
 
 	if (!search_get_sequid(ibox, args, &first_seq, &last_seq,
-			       first_uid, last_uid, FALSE))
+			       first_uid, last_uid))
 		return -1;
 
 	/* seq_update() should make sure that these can't happen */




More information about the dovecot-cvs mailing list