diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-23 14:02:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-23 14:02:52 +0000 |
commit | d2efe262a0dda14e37d3787e8c52dae4ae6a8bab (patch) | |
tree | 1abf4b3d372611cc0cd4507a7c27f513e9a57345 /src/core | |
parent | b0f5a7b53015ad3de87da115c940ba92f6143116 (diff) | |
download | gnunet-d2efe262a0dda14e37d3787e8c52dae4ae6a8bab.tar.gz gnunet-d2efe262a0dda14e37d3787e8c52dae4ae6a8bab.zip |
simplify logic
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/gnunet-service-core_clients.c | 8 | ||||
-rw-r--r-- | 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, | |||
668 | 668 | ||
669 | old_match = GSC_TYPEMAP_test_match (tmap_old, client->types, client->tcnt); | 669 | old_match = GSC_TYPEMAP_test_match (tmap_old, client->types, client->tcnt); |
670 | new_match = GSC_TYPEMAP_test_match (tmap_new, client->types, client->tcnt); | 670 | new_match = GSC_TYPEMAP_test_match (tmap_new, client->types, client->tcnt); |
671 | if (client->tcnt == 0) | ||
672 | { | ||
673 | /* empty list matches ALL (if not NULL) */ | ||
674 | if (tmap_new != NULL) | ||
675 | new_match = GNUNET_YES; | ||
676 | if (tmap_old != NULL) | ||
677 | old_match = GNUNET_YES; | ||
678 | } | ||
679 | if (old_match == new_match) | 671 | if (old_match == new_match) |
680 | return; /* no change */ | 672 | return; /* no change */ |
681 | if (old_match == GNUNET_NO) | 673 | 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, | |||
227 | 227 | ||
228 | if (NULL == tmap) | 228 | if (NULL == tmap) |
229 | return GNUNET_NO; | 229 | return GNUNET_NO; |
230 | if (0 == tcnt) | ||
231 | return GNUNET_YES; /* matches all */ | ||
230 | for (i=0;i<tcnt;i++) | 232 | for (i=0;i<tcnt;i++) |
231 | if (0 != (tmap->bits[types[i] / 32] & (1 << (types[i] % 32)))) | 233 | if (0 != (tmap->bits[types[i] / 32] & (1 << (types[i] % 32)))) |
232 | return GNUNET_YES; | 234 | return GNUNET_YES; |