]> git.meshlink.io Git - catta/commitdiff
add a bunch of record comparison shortcuts
authorLennart Poettering <lennart@poettering.net>
Wed, 4 May 2005 11:00:11 +0000 (11:00 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 May 2005 11:00:11 +0000 (11:00 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@41 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

rr.c

diff --git a/rr.c b/rr.c
index db816588e2ccf878825cdd8d91908f6a76c25627..0775d45b5ac5a6e69b48e253dea48e370ec549ba 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -213,6 +213,9 @@ gboolean flx_key_equal(const flxKey *a, const flxKey *b) {
     g_assert(a);
     g_assert(b);
 
+    if (a == b)
+        return TRUE;
+    
 /*     g_message("equal: %p %p", a, b); */
     
     return flx_domain_equal(a->name, b->name) &&
@@ -227,6 +230,9 @@ gboolean flx_key_pattern_match(const flxKey *pattern, const flxKey *k) {
 /*     g_message("equal: %p %p", a, b); */
 
     g_assert(!flx_key_is_pattern(k));
+
+    if (pattern == k)
+        return TRUE;
     
     return flx_domain_equal(pattern->name, k->name) &&
         (pattern->type == k->type || pattern->type == FLX_DNS_TYPE_ANY) &&
@@ -297,6 +303,9 @@ gboolean flx_record_equal_no_ttl(const flxRecord *a, const flxRecord *b) {
     g_assert(a);
     g_assert(b);
 
+    if (a == b)
+        return TRUE;
+
     return
         flx_key_equal(a->key, b->key) &&
         rdata_equal(a, b);
@@ -456,6 +465,9 @@ gint flx_record_lexicographical_compare(flxRecord *a, flxRecord *b) {
     g_assert(a);
     g_assert(b);
 
+    if (a == b)
+        return 0;
+    
 /*     gchar *t; */
 
 /*     g_message("comparing [%s]", t = flx_record_to_string(a)); */