From a00202b632e615d840cf7fb5a3cc800d7d0125b7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 24 Mar 2020 17:51:57 +0200 Subject: [PATCH] imap: SETMETADATA - Reorder if checks to remove unnecessary indenting Nothing changes in the code logic. --- src/imap/cmd-setmetadata.c | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/imap/cmd-setmetadata.c b/src/imap/cmd-setmetadata.c index 6f309cde79..85be2eab4e 100644 --- a/src/imap/cmd-setmetadata.c +++ b/src/imap/cmd-setmetadata.c @@ -129,33 +129,33 @@ cmd_setmetadata_entry_read_stream(struct imap_setmetadata_context *ctx) while ((ret = i_stream_read_more(ctx->input, &data, &size)) > 0) i_stream_skip(ctx->input, size); - if (ret < 0) { - if (ctx->input->v_offset != ctx->entry_value_len) { - /* client disconnected */ - i_assert(ctx->input->eof); - return -1; - } + if (ret == 0) + return 0; - /* finished reading the value */ - i_stream_seek(ctx->input, 0); + if (ctx->input->v_offset != ctx->entry_value_len) { + /* client disconnected */ + i_assert(ctx->input->eof); + return -1; + } - if (ctx->failed) { - i_stream_unref(&ctx->input); - return 1; - } + /* finished reading the value */ + i_stream_seek(ctx->input, 0); - i_zero(&value); - value.value_stream = ctx->input; - if (imap_metadata_set(ctx->trans, ctx->entry_name, &value) < 0) { - /* delay reporting the failure so we'll finish - reading the command input */ - ctx->storage_failure = TRUE; - ctx->failed = TRUE; - } + if (ctx->failed) { i_stream_unref(&ctx->input); return 1; } - return 0; + + i_zero(&value); + value.value_stream = ctx->input; + if (imap_metadata_set(ctx->trans, ctx->entry_name, &value) < 0) { + /* delay reporting the failure so we'll finish + reading the command input */ + ctx->storage_failure = TRUE; + ctx->failed = TRUE; + } + i_stream_unref(&ctx->input); + return 1; } static int -- 2.47.3