From: Jérémie Galarneau Date: Fri, 17 Aug 2018 17:25:39 +0000 (-0400) Subject: Add a by-address equality short-circuit to condition comparison X-Git-Tag: v2.11.0-rc1~130 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6c2fe31927dd91be5a75702cd5399fd3aa04174f;p=lttng-tools.git Add a by-address equality short-circuit to condition comparison Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/condition.c b/src/common/condition.c index 9a9e9babd..6cebeb03f 100644 --- a/src/common/condition.c +++ b/src/common/condition.c @@ -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;