comparison libpurple/protocols/msn/userlist.c @ 28952:8724fcca91ba

I find the code easier to read this way
author Mark Doliner <mark@kingant.net>
date Wed, 03 Feb 2010 21:24:55 +0000
parents 7aef89b92589
children 08296b862f98
comparison
equal deleted inserted replaced
28951:0f8a1e98408b 28952:8724fcca91ba
117 return FALSE; 117 return FALSE;
118 118
119 if (group_id == NULL) 119 if (group_id == NULL)
120 return FALSE; 120 return FALSE;
121 121
122 if (g_list_find_custom(user->group_ids, group_id, (GCompareFunc)strcmp)) 122 return (g_list_find_custom(user->group_ids, group_id, (GCompareFunc)strcmp)) != NULL;
123 return TRUE;
124
125 return FALSE;
126 } 123 }
127 124
128 gboolean 125 gboolean
129 msn_userlist_user_is_in_list(MsnUser *user, MsnListId list_id) 126 msn_userlist_user_is_in_list(MsnUser *user, MsnListId list_id)
130 { 127 {
131 int list_op;
132
133 if (user == NULL) 128 if (user == NULL)
134 return FALSE; 129 return FALSE;
135 130
136 list_op = 1 << list_id; 131 return (user->list_op & (1 << list_id));
137
138 if (user->list_op & list_op)
139 return TRUE;
140 else
141 return FALSE;
142 } 132 }
143 133
144 /************************************************************************** 134 /**************************************************************************
145 * Server functions 135 * Server functions
146 **************************************************************************/ 136 **************************************************************************/