diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-26 11:55:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-26 11:55:44 +0000 |
commit | 3ad9123d92423ebf5639ecb86a8e5dd491dffd38 (patch) | |
tree | 9f42f995f47e08b1eeeeff628f30d3df708ffcfd /src/regex/regex_internal_dht.c | |
parent | d8076558c37b4b4984d8b6530b378551d9d4ee05 (diff) | |
download | gnunet-3ad9123d92423ebf5639ecb86a8e5dd491dffd38.tar.gz gnunet-3ad9123d92423ebf5639ecb86a8e5dd491dffd38.zip |
-inline trivial static function that is only called once
Diffstat (limited to 'src/regex/regex_internal_dht.c')
-rw-r--r-- | src/regex/regex_internal_dht.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/src/regex/regex_internal_dht.c b/src/regex/regex_internal_dht.c index 5618eb66a..28ab884eb 100644 --- a/src/regex/regex_internal_dht.c +++ b/src/regex/regex_internal_dht.c | |||
@@ -729,7 +729,6 @@ regex_free_result (void *cls, | |||
729 | const struct GNUNET_HashCode * key, | 729 | const struct GNUNET_HashCode * key, |
730 | void *value) | 730 | void *value) |
731 | { | 731 | { |
732 | |||
733 | GNUNET_free (value); | 732 | GNUNET_free (value); |
734 | return GNUNET_YES; | 733 | return GNUNET_YES; |
735 | } | 734 | } |
@@ -738,37 +737,28 @@ regex_free_result (void *cls, | |||
738 | /** | 737 | /** |
739 | * Cancel an ongoing regex search in the DHT and free all resources. | 738 | * Cancel an ongoing regex search in the DHT and free all resources. |
740 | * | 739 | * |
741 | * @param ctx The search context. | 740 | * @param h the search context. |
742 | */ | 741 | */ |
743 | static void | 742 | void |
744 | regex_cancel_search (struct REGEX_INTERNAL_Search *ctx) | 743 | REGEX_INTERNAL_search_cancel (struct REGEX_INTERNAL_Search *h) |
745 | { | 744 | { |
746 | GNUNET_free (ctx->description); | 745 | unsigned int i; |
747 | GNUNET_CONTAINER_multihashmap_iterate (ctx->dht_get_handles, | 746 | |
747 | GNUNET_free (h->description); | ||
748 | GNUNET_CONTAINER_multihashmap_iterate (h->dht_get_handles, | ||
748 | ®ex_cancel_dht_get, NULL); | 749 | ®ex_cancel_dht_get, NULL); |
749 | GNUNET_CONTAINER_multihashmap_iterate (ctx->dht_get_results, | 750 | GNUNET_CONTAINER_multihashmap_iterate (h->dht_get_results, |
750 | ®ex_free_result, NULL); | 751 | ®ex_free_result, NULL); |
751 | GNUNET_CONTAINER_multihashmap_destroy (ctx->dht_get_results); | 752 | GNUNET_CONTAINER_multihashmap_destroy (h->dht_get_results); |
752 | GNUNET_CONTAINER_multihashmap_destroy (ctx->dht_get_handles); | 753 | GNUNET_CONTAINER_multihashmap_destroy (h->dht_get_handles); |
753 | if (0 < ctx->n_contexts) | 754 | if (0 < h->n_contexts) |
754 | { | 755 | { |
755 | int i; | 756 | for (i = 0; i < h->n_contexts; i++) |
756 | 757 | GNUNET_free (h->contexts[i]); | |
757 | for (i = 0; i < ctx->n_contexts; i++) | 758 | GNUNET_free (h->contexts); |
758 | { | ||
759 | GNUNET_free (ctx->contexts[i]); | ||
760 | } | ||
761 | GNUNET_free (ctx->contexts); | ||
762 | } | 759 | } |
763 | } | ||
764 | |||
765 | void | ||
766 | REGEX_INTERNAL_search_cancel (struct REGEX_INTERNAL_Search *h) | ||
767 | { | ||
768 | regex_cancel_search (h); | ||
769 | GNUNET_free (h); | 760 | GNUNET_free (h); |
770 | } | 761 | } |
771 | 762 | ||
772 | 763 | ||
773 | 764 | /* end of regex_internal_dht.c */ | |
774 | /* end of regex_dht.c */ | ||