pidgin: f34a9d45: I find the code easier to read this way

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Feb 3 17:05:33 EST 2010


-----------------------------------------------------------------
Revision: f34a9d45f9fd63b92e95fe69115042eadbe7c053
Ancestor: 4c80922f4ca459530e31cd566dab77e831a5cc23
Author: markdoliner at pidgin.im
Date: 2010-02-03T21:24:55
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f34a9d45f9fd63b92e95fe69115042eadbe7c053

Modified files:
        libpurple/protocols/msn/userlist.c

ChangeLog: 

I find the code easier to read this way

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/userlist.c	6f11f760f9934c24469c5a8d204e28b22c254bf1
+++ libpurple/protocols/msn/userlist.c	c05e859588dff1534487aa18b641838571d7c51c
@@ -119,26 +119,16 @@ msn_userlist_user_is_in_group(MsnUser *u
 	if (group_id == NULL)
 		return FALSE;
 
-	if (g_list_find_custom(user->group_ids, group_id, (GCompareFunc)strcmp))
-		return TRUE;
-
-	return FALSE;
+	return (g_list_find_custom(user->group_ids, group_id, (GCompareFunc)strcmp)) != NULL;
 }
 
 gboolean
 msn_userlist_user_is_in_list(MsnUser *user, MsnListId list_id)
 {
-	int list_op;
-
 	if (user == NULL)
 		return FALSE;
 
-	list_op = 1 << list_id;
-
-	if (user->list_op & list_op)
-		return TRUE;
-	else
-		return FALSE;
+	return (user->list_op & (1 << list_id));
 }
 
 /**************************************************************************


More information about the Commits mailing list