]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: slightly shorten dns_resource_key_compare_func()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Dec 2020 13:29:21 +0000 (22:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Dec 2020 16:22:59 +0000 (01:22 +0900)
src/resolve/resolved-dns-rr.c

index 219f66451ae33bf2483b66947be6cc83c5e89e90..624120bd47ce447166c919b833c2fe1cb87e7258 100644 (file)
@@ -294,21 +294,17 @@ static void dns_resource_key_hash_func(const DnsResourceKey *k, struct siphash *
 }
 
 static int dns_resource_key_compare_func(const DnsResourceKey *x, const DnsResourceKey *y) {
-        int ret;
-
-        ret = dns_name_compare_func(dns_resource_key_name(x), dns_resource_key_name(y));
-        if (ret != 0)
-                return ret;
+        int r;
 
-        ret = CMP(x->type, y->type);
-        if (ret != 0)
-                return ret;
+        r = dns_name_compare_func(dns_resource_key_name(x), dns_resource_key_name(y));
+        if (r != 0)
+                return r;
 
-        ret = CMP(x->class, y->class);
-        if (ret != 0)
-                return ret;
+        r = CMP(x->type, y->type);
+        if (r != 0)
+                return r;
 
-        return 0;
+        return CMP(x->class, y->class);
 }
 
 DEFINE_HASH_OPS(dns_resource_key_hash_ops, DnsResourceKey, dns_resource_key_hash_func, dns_resource_key_compare_func);