]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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 d3a6c14ed1d38783092e465f7c4a40f4c6ec31a8..938b43f225010b04bd1839b3ed363c08622c326a 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)