From d2efe262a0dda14e37d3787e8c52dae4ae6a8bab Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 23 Oct 2011 14:02:52 +0000 Subject: [PATCH] simplify logic --- src/core/gnunet-service-core_clients.c | 8 -------- src/core/gnunet-service-core_typemap.c | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c index b2dd675fb..ccc76f765 100644 --- a/src/core/gnunet-service-core_clients.c +++ b/src/core/gnunet-service-core_clients.c @@ -668,14 +668,6 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, old_match = GSC_TYPEMAP_test_match (tmap_old, client->types, client->tcnt); new_match = GSC_TYPEMAP_test_match (tmap_new, client->types, client->tcnt); - if (client->tcnt == 0) - { - /* empty list matches ALL (if not NULL) */ - if (tmap_new != NULL) - new_match = GNUNET_YES; - if (tmap_old != NULL) - old_match = GNUNET_YES; - } if (old_match == new_match) return; /* no change */ if (old_match == GNUNET_NO) diff --git a/src/core/gnunet-service-core_typemap.c b/src/core/gnunet-service-core_typemap.c index 5d40820df..c54e446c6 100644 --- a/src/core/gnunet-service-core_typemap.c +++ b/src/core/gnunet-service-core_typemap.c @@ -227,6 +227,8 @@ GSC_TYPEMAP_test_match (const struct GSC_TypeMap *tmap, if (NULL == tmap) return GNUNET_NO; + if (0 == tcnt) + return GNUNET_YES; /* matches all */ for (i=0;ibits[types[i] / 32] & (1 << (types[i] % 32)))) return GNUNET_YES; -- 2.25.1