Cleanup: improve readability of filter expression condition
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 17:45:40 +0000 (13:45 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 17:45:59 +0000 (13:45 -0400)
In this situation, a logical inequality '!=' is equivalent to the
binary xor '^' that was used.

However, while it is equivalent, mixing logical ('!') and bitwise
operators ('^') makes this code harder to read than it needs to be.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/agent.c

index 310a7e8e1f7513dba73bd9d8d6a07ed16998eead..3b8acd2a2a0a57093c0d9822c7180a67f310b005 100644 (file)
@@ -143,7 +143,7 @@ static int ht_match_event(struct cds_lfht_node *node,
        }
 
        /* Filter expression */
        }
 
        /* Filter expression */
-       if (!!event->filter_expression ^ !!key->filter_expression) {
+       if (!!event->filter_expression != !!key->filter_expression) {
                /* One has a filter expression, the other does not */
                goto no_match;
        }
                /* One has a filter expression, the other does not */
                goto no_match;
        }
This page took 0.027767 seconds and 5 git commands to generate.