resolved: minor optimization for dns_question_is_equal()
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Jan 2016 19:22:45 +0000 (20:22 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 Jan 2016 22:31:16 +0000 (23:31 +0100)
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

index d3a6c14..938b43f 100644 (file)
@@ -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)