I'm pretty sure this is unnecessary. Consider the four cases:
value of data->account | 0 | x |
value of account | 0 | y | 0 | y |
a. data->account == NULL | t | f | t | f |
b. account == NULL | t | t | f | f |
c. a != b | f | t | t | f |
d. data->account == account | t | f | f | x == y |
e. equal | t | f | f | x == y |
In all cases, the value of equal is identical to what it would have been
if the else branch were always taken. So... let's just always take the
else branch.
gtk_tree_model_get (model, iter, COL_ACCOUNT_POINTER, &account, -1);
- /* Special case so we can make it possible to select the All option */
- if ((data->account == NULL) != (account == NULL)) {
- equal = FALSE;
- }
- else {
- equal = (data->account == account);
- }
+ equal = (data->account == account);
if (account) {
g_object_unref (account);