Add a by-address equality short-circuit to condition comparison
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Aug 2018 17:25:39 +0000 (13:25 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 23 Aug 2018 00:18:09 +0000 (20:18 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/condition.c

index 9a9e9babdfa19a7145f22508bc81b863f1406078..6cebeb03f7bb9d35e651a9a110bb36f087cfd1fe 100644 (file)
@@ -104,6 +104,11 @@ bool lttng_condition_is_equal(const struct lttng_condition *a,
                goto end;
        }
 
+       if (a == b) {
+               is_equal = true;
+               goto end;
+       }
+
        is_equal = a->equal ? a->equal(a, b) : true;
 end:
        return is_equal;
This page took 0.02537 seconds and 4 git commands to generate.