Skip to content

Commit b680068

Browse files
committed
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.
1 parent 0f7091e commit b680068

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/resolve/resolved-dns-question.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ int dns_question_is_equal(DnsQuestion *a, DnsQuestion *b) {
183183
unsigned j;
184184
int r;
185185

186+
if (a == b)
187+
return 1;
188+
186189
if (!a)
187190
return !b || b->n_keys == 0;
188191
if (!b)

0 commit comments

Comments
 (0)