From e5bb4e86ac35b84b87bf6e085859053db9136245 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 8 Mar 2013 23:02:20 +0000 Subject: [PATCH] email: Simplified nesting of if statements in *_doing() functions --- lib/imap.c | 8 +++----- lib/pop3.c | 8 +++----- lib/smtp.c | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index ae5ec86c2..136d64379 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -2194,12 +2194,10 @@ static CURLcode imap_doing(struct connectdata *conn, bool *dophase_done) if(result) DEBUGF(infof(conn->data, "DO phase failed\n")); - else { - if(*dophase_done) { - result = imap_dophase_done(conn, FALSE /* not connected */); + else if(*dophase_done) { + result = imap_dophase_done(conn, FALSE /* not connected */); - DEBUGF(infof(conn->data, "DO phase is complete\n")); - } + DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; diff --git a/lib/pop3.c b/lib/pop3.c index 959266415..28a359ebe 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -1566,12 +1566,10 @@ static CURLcode pop3_doing(struct connectdata *conn, bool *dophase_done) if(result) DEBUGF(infof(conn->data, "DO phase failed\n")); - else { - if(*dophase_done) { - result = pop3_dophase_done(conn, FALSE /* not connected */); + else if(*dophase_done) { + result = pop3_dophase_done(conn, FALSE /* not connected */); - DEBUGF(infof(conn->data, "DO phase is complete\n")); - } + DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; diff --git a/lib/smtp.c b/lib/smtp.c index 0f04397cc..21c202e3c 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1565,12 +1565,10 @@ static CURLcode smtp_doing(struct connectdata *conn, bool *dophase_done) if(result) DEBUGF(infof(conn->data, "DO phase failed\n")); - else { - if(*dophase_done) { - result = smtp_dophase_done(conn, FALSE /* not connected */); + else if(*dophase_done) { + result = smtp_dophase_done(conn, FALSE /* not connected */); - DEBUGF(infof(conn->data, "DO phase is complete\n")); - } + DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result;