diff options
author | Filipe Brandenburger <filbranden@google.com> | 2018-08-06 19:21:38 -0700 |
---|---|---|
committer | Filipe Brandenburger <filbranden@google.com> | 2018-08-06 19:26:44 -0700 |
commit | 53c5797fbde10cb0d133b3b11789fb299411468e (patch) | |
tree | b4f7fd8ecce9d364767b5bcfccca7113fd3a2916 /src/resolve | |
parent | a0edd02e43b06ec877bedb6ccf622e6748ccdf64 (diff) | |
download | systemd-53c5797fbde10cb0d133b3b11789fb299411468e.tar.gz |
resolve: use CMP() in dns_resource_record_compare_func
This function doesn't really implement ordering, but CMP() is still fine to use
there. Keep the comment in place, just update it slightly to indicate that.
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-rr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index 05a4915101..e6d997ed97 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -1513,10 +1513,9 @@ static int dns_resource_record_compare_func(const void *a, const void *b) { if (dns_resource_record_equal(x, y)) return 0; - /* This is a bit dirty, we don't implement proper ordering, but - * the hashtable doesn't need ordering anyway, hence we don't - * care. */ - return x < y ? -1 : 1; + /* We still use CMP() here, even though don't implement proper + * ordering, since the hashtable doesn't need ordering anyway. */ + return CMP(x, y); } const struct hash_ops dns_resource_record_hash_ops = { |