commit 06b180fe03d469f41f62442398172a89b7298564
Author: Oswald Buddenhagen <[email protected]>
Date: Sun Mar 20 18:23:09 2011 +0100
centralize imap_cmd_refcounted_state refcount decrementing
no else branches remain, so the if() can be put into
imap_refcounted_done()
src/drv_imap.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/drv_imap.c b/src/drv_imap.c
index b5c28a7..6705559 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -423,9 +423,12 @@ imap_refcounted_new_cmd( struct imap_cmd_refcounted_state
*sts )
static int
imap_refcounted_done( struct imap_cmd_refcounted_state *sts )
{
- int ret = sts->callback( sts->ret_val, sts->callback_aux );
- free( sts );
- return ret;
+ if (!--sts->ref_count) {
+ int ret = sts->callback( sts->ret_val, sts->callback_aux );
+ free( sts );
+ return ret;
+ }
+ return 0;
}
static int
@@ -1513,9 +1516,7 @@ imap_select2_p2( imap_store_t *ctx ATTR_UNUSED, struct
imap_cmd *cmd, int respon
sts->ret_val = DRV_BOX_BAD;
break;
}
- if (!--sts->ref_count)
- return imap_refcounted_done( sts );
- return 0;
+ return imap_refcounted_done( sts );
}
/******************* imap_fetch_msg *******************/
@@ -1604,9 +1605,7 @@ imap_set_flags_p2( imap_store_t *ctx ATTR_UNUSED, struct
imap_cmd *cmd, int resp
sts->ret_val = DRV_MSG_BAD;
break;
}
- if (!--sts->ref_count)
- return imap_refcounted_done( sts );
- return 0;
+ return imap_refcounted_done( sts );
}
/******************* imap_close *******************/
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel