changeset 18686:041b6b9921c5

fts-lucene: Removed dead code Found by Coverity
author Timo Sirainen <tss@iki.fi>
date Wed, 13 May 2015 21:35:56 +0300
parents 13787b077df4
children cc6b6d7c1574
files src/plugins/fts-lucene/fts-backend-lucene.c
diffstat 1 files changed, 9 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }