# HG changeset patch # User Evan Schoenberg # Date 1179002006 0 # Node ID 73556f13c3b5487ff03e2b744192b295e827083d # Parent f1547260a11eaa8ac364f76e4da87aba7f1bf4a2 Use switch() rather than a series of if() statements which hit all the values of the enum diff -r f1547260a11e -r 73556f13c3b5 libpurple/conversation.c --- a/libpurple/conversation.c Sat May 12 14:28:59 2007 +0000 +++ b/libpurple/conversation.c Sat May 12 20:33:26 2007 +0000 @@ -970,20 +970,20 @@ { im->typing_state = state; - if (state == PURPLE_TYPING) - { - purple_signal_emit(purple_conversations_get_handle(), - "buddy-typing", im->conv->account, im->conv->name); - } - else if (state == PURPLE_TYPED) + switch (state) { - purple_signal_emit(purple_conversations_get_handle(), - "buddy-typed", im->conv->account, im->conv->name); - } - else if (state == PURPLE_NOT_TYPING) - { - purple_signal_emit(purple_conversations_get_handle(), - "buddy-typing-stopped", im->conv->account, im->conv->name); + case PURPLE_TYPING: + purple_signal_emit(purple_conversations_get_handle(), + "buddy-typing", im->conv->account, im->conv->name); + break; + case PURPLE_TYPED: + purple_signal_emit(purple_conversations_get_handle(), + "buddy-typed", im->conv->account, im->conv->name); + break; + case PURPLE_NOT_TYPING: + purple_signal_emit(purple_conversations_get_handle(), + "buddy-typing-stopped", im->conv->account, im->conv->name); + break; } } }