dovecot: Don't bother compressing cache file just to drop fields...

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 6 21:56:12 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/4752637a6ad4
changeset: 6707:4752637a6ad4
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 06 21:54:37 2007 +0200
description:
Don't bother compressing cache file just to drop fields from header that
have never been used.

diffstat:

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

diffs (16 lines):

diff -r 4f999ac56a53 -r 4752637a6ad4 src/lib-index/mail-cache-fields.c
--- a/src/lib-index/mail-cache-fields.c	Tue Nov 06 21:26:02 2007 +0200
+++ b/src/lib-index/mail-cache-fields.c	Tue Nov 06 21:54:37 2007 +0200
@@ -361,8 +361,10 @@ int mail_cache_header_fields_read(struct
 		if (last_used[i] > cache->fields[field.idx].last_used)
 			cache->fields[field.idx].last_used = last_used[i];
 
-		if (cache->fields[field.idx].last_used < max_drop_time) {
-			/* time to drop this field */
+		if (cache->fields[field.idx].last_used < max_drop_time &&
+		    cache->fields[field.idx].last_used != 0) {
+			/* time to drop this field. don't bother dropping
+			   fields that have never been used. */
 			cache->need_compress_file_seq = cache->hdr->file_seq;
 		}
 


More information about the dovecot-cvs mailing list