summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-18 20:22:45 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-18 23:31:16 +0100
commitb6800689e03456efd0430d171ebf962f64b94eb0 (patch)
tree672f2b352ec3c393d3472875b870cda502b7a61b /src
parent0f7091e624fdba6c0bf281f2a9a23cd3e9ca93fb (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.
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-dns-question.c3
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)