diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-18 20:22:45 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-18 23:31:16 +0100 |
commit | b6800689e03456efd0430d171ebf962f64b94eb0 (patch) | |
tree | 672f2b352ec3c393d3472875b870cda502b7a61b | |
parent | 0f7091e624fdba6c0bf281f2a9a23cd3e9ca93fb (diff) |
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.
-rw-r--r-- | src/resolve/resolved-dns-question.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-question.c b/src/resolve/resolved-dns-question.c index d3a6c14ed1..938b43f225 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) |