[dovecot-cvs] dovecot/src/lib-storage mail-search.c,1.14,1.15
mail-search.h,1.10,1.11
cras at procontrol.fi
cras at procontrol.fi
Sun Oct 26 21:41:12 EET 2003
Update of /home/cvs/dovecot/src/lib-storage
In directory danu:/tmp/cvs-serv5094
Modified Files:
mail-search.c mail-search.h
Log Message:
Some optimizations to messageset handling in search.
Index: mail-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-search.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- mail-search.c 21 Sep 2003 16:21:37 -0000 1.14
+++ mail-search.c 26 Oct 2003 19:41:09 -0000 1.15
@@ -4,12 +4,22 @@
#include "buffer.h"
#include "mail-search.h"
-void mail_search_args_reset(struct mail_search_arg *args)
+void mail_search_args_reset(struct mail_search_arg *args, int full_reset)
{
while (args != NULL) {
if (args->type == SEARCH_OR || args->type == SEARCH_SUB)
- mail_search_args_reset(args->value.subargs);
- args->result = -1;
+ mail_search_args_reset(args->value.subargs, full_reset);
+
+ if (!args->match_always)
+ args->result = -1;
+ else {
+ if (!full_reset)
+ args->result = 1;
+ else {
+ args->match_always = FALSE;
+ args->result = -1;
+ }
+ }
args = args->next;
}
Index: mail-search.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-search.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mail-search.h 6 Aug 2003 20:15:32 -0000 1.10
+++ mail-search.h 26 Oct 2003 19:41:09 -0000 1.11
@@ -52,6 +52,7 @@
void *context;
const char *hdr_field_name; /* for SEARCH_HEADER* */
unsigned int not:1;
+ unsigned int match_always:1; /* result = 1 always */
int result; /* -1 = unknown, 0 = unmatched, 1 = matched */
};
@@ -65,8 +66,9 @@
typedef void (*mail_search_foreach_callback_t)(struct mail_search_arg *arg,
void *context);
-/* Reset the results in search arguments */
-void mail_search_args_reset(struct mail_search_arg *args);
+/* Reset the results in search arguments. match_always is reset only if
+ full_reset is TRUE. */
+void mail_search_args_reset(struct mail_search_arg *args, int full_reset);
/* goes through arguments in list that don't have a result yet.
Returns 1 = search matched, 0 = search unmatched, -1 = don't know yet */
More information about the dovecot-cvs
mailing list