[dovecot-cvs] dovecot/src/lib-storage/index index-search.c,1.61,1.62 index-sort.c,1.8,1.9

cras at procontrol.fi cras at procontrol.fi
Sat Jan 11 19:48:27 EET 2003


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

Modified Files:
	index-search.c index-sort.c 
Log Message:
SORT optimization. It now uses memory to store one or two of the sort
criteria items. Should be "fast enough" now, sorting ~4000 messages doesn't
take hardly any time.



Index: index-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- index-search.c	10 Jan 2003 00:30:42 -0000	1.61
+++ index-search.c	11 Jan 2003 17:48:25 -0000	1.62
@@ -948,7 +948,7 @@
 		index_sort_ctx.output = output;
 
 		thread_ctx = NULL;
-		sort_ctx = mail_sort_init(sort_unsorted, sorting,
+		sort_ctx = mail_sort_init(sort_unsorted, sorting, output,
 					  &index_sort_callbacks,
 					  &index_sort_ctx);
 		o_stream_send_str(output, "* SORT");

Index: index-sort.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-sort.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- index-sort.c	10 Jan 2003 00:30:42 -0000	1.8
+++ index-sort.c	11 Jan 2003 17:48:25 -0000	1.9
@@ -154,25 +154,10 @@
 	ctx->cached = FALSE;
 }
 
-static void _output(unsigned int *data, size_t count, void *context)
-{
-	struct index_sort_context *ctx = context;
-	size_t i;
-
-	/* FIXME: works only with UIDs! */
-	for (i = 0; i < count; i++) {
-		t_push();
-		o_stream_send(ctx->output, " ", 1);
-		o_stream_send_str(ctx->output, dec2str(data[i]));
-		t_pop();
-	}
-}
-
 struct mail_sort_callbacks index_sort_callbacks = {
 	_input_time,
 	_input_uofft,
 	_input_mailbox,
 	_input_str,
-	_input_reset,
-	_output
+	_input_reset
 };




More information about the dovecot-cvs mailing list