From b6800689e03456efd0430d171ebf962f64b94eb0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 18 Jan 2016 20:22:45 +0100 Subject: [PATCH] resolved: minor optimization for dns_question_is_equal() If the poinetrs are equal, we don't have to do a deep comparison. This is similar to a similar optimization we already have in place for RRs and keys. --- src/resolve/resolved-dns-question.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/resolve/resolved-dns-question.c b/src/resolve/resolved-dns-question.c index d3a6c14..938b43f 100644 --- a/src/resolve/resolved-dns-question.c +++ b/src/resolve/resolved-dns-question.c @@ -183,6 +183,9 @@ int dns_question_is_equal(DnsQuestion *a, DnsQuestion *b) { unsigned j; int r; + if (a == b) + return 1; + if (!a) return !b || b->n_keys == 0; if (!b) -- 2.7.4