changeset 17059:73556f13c3b5

Use switch() rather than a series of if() statements which hit all the values of the enum
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 12 May 2007 20:33:26 +0000
parents f1547260a11e
children bfdd46b72027
files libpurple/conversation.c
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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;
 		}
 	}
 }