dovecot-2.2: fts-lucene: Removed dead code

dovecot at dovecot.org dovecot at dovecot.org
Wed May 13 18:37:56 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/041b6b9921c5
changeset: 18686:041b6b9921c5
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 13 21:35:56 2015 +0300
description:
fts-lucene: Removed dead code
Found by Coverity

diffstat:

 src/plugins/fts-lucene/fts-backend-lucene.c |  23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diffs (37 lines):

diff -r 13787b077df4 -r 041b6b9921c5 src/plugins/fts-lucene/fts-backend-lucene.c
--- a/src/plugins/fts-lucene/fts-backend-lucene.c	Wed May 13 20:47:35 2015 +0300
+++ b/src/plugins/fts-lucene/fts-backend-lucene.c	Wed May 13 21:35:56 2015 +0300
@@ -96,24 +96,19 @@
 	    backend->selected_box_generation == box->generation_sequence)
 		return 0;
 
-	if (box != NULL) {
-		if (fts_lucene_get_mailbox_guid(box, guid) < 0)
-			return -1;
-		buffer_create_from_data(&buf, guid_hex, MAILBOX_GUID_HEX_LENGTH);
-		binary_to_hex_append(&buf, guid, GUID_128_SIZE);
-		for (i = 0; i < N_ELEMENTS(wguid_hex); i++)
-			wguid_hex[i] = guid_hex[i];
+	if (fts_lucene_get_mailbox_guid(box, guid) < 0)
+		return -1;
+	buffer_create_from_data(&buf, guid_hex, MAILBOX_GUID_HEX_LENGTH);
+	binary_to_hex_append(&buf, guid, GUID_128_SIZE);
+	for (i = 0; i < N_ELEMENTS(wguid_hex); i++)
+		wguid_hex[i] = guid_hex[i];
 
-		lucene_index_select_mailbox(backend->index, wguid_hex);
-	} else {
-		lucene_index_unselect_mailbox(backend->index);
-		memset(&guid, 0, sizeof(guid));
-	}
+	lucene_index_select_mailbox(backend->index, wguid_hex);
+
 	backend->selected_box = box;
 	memcpy(backend->selected_box_guid, guid,
 	       sizeof(backend->selected_box_guid));
-	backend->selected_box_generation =
-		box == NULL ? 0 : box->generation_sequence;
+	backend->selected_box_generation = box->generation_sequence;
 	return 0;
 }
 


More information about the dovecot-cvs mailing list