]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: don't check for NULL DnsAnswer object explicitly where unnecessary
authorLennart Poettering <lennart@poettering.net>
Fri, 18 Dec 2015 13:29:32 +0000 (14:29 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Dec 2015 13:48:49 +0000 (14:48 +0100)
The DNS_ANSWER_FOREACH macros do this internally anyway, no need to
duplicate this.

src/resolve/resolved-dns-answer.c

index 5355303bd33aca9fa91ede7d3b14b4732458822c..727fa750679a27baaaa708ce4dc881b0c17bb03b 100644 (file)
@@ -233,9 +233,6 @@ int dns_answer_find_soa(DnsAnswer *a, const DnsResourceKey *key, DnsResourceReco
 
         assert(key);
 
-        if (!a)
-                return 0;
-
         /* For a SOA record we can never find a matching SOA record */
         if (key->type == DNS_TYPE_SOA)
                 return 0;
@@ -260,9 +257,6 @@ int dns_answer_find_cname_or_dname(DnsAnswer *a, const DnsResourceKey *key, DnsR
 
         assert(key);
 
-        if (!a)
-                return 0;
-
         /* For a {C,D}NAME record we can never find a matching {C,D}NAME record */
         if (key->type == DNS_TYPE_CNAME || key->type == DNS_TYPE_DNAME)
                 return 0;