diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-04 14:03:41 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-04 14:03:41 +0200 |
commit | 94f9368aa103f6fc382b9cdff9a8176703ef3c31 (patch) | |
tree | 7bc0f155f3e46f26eaabafbe67491df192de1170 /src/rps/gnunet-rps-profiler.c | |
parent | 45deaaedad922fe114df9f5bb0e23fbec7c64f02 (diff) | |
parent | 8c3d9fc59cd5617c4f5b7ea621971bdff25f5353 (diff) | |
download | gnunet-94f9368aa103f6fc382b9cdff9a8176703ef3c31.tar.gz gnunet-94f9368aa103f6fc382b9cdff9a8176703ef3c31.zip |
Merge branch 'master' of git+ssh://gnunet.org/gnunet
Diffstat (limited to 'src/rps/gnunet-rps-profiler.c')
-rw-r--r-- | src/rps/gnunet-rps-profiler.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c index af27546f2..a852d94b1 100644 --- a/src/rps/gnunet-rps-profiler.c +++ b/src/rps/gnunet-rps-profiler.c | |||
@@ -1041,7 +1041,9 @@ cancel_request (struct PendingReply *pending_rep) | |||
1041 | "Cancelling rps get reply\n"); | 1041 | "Cancelling rps get reply\n"); |
1042 | GNUNET_assert (NULL != pending_rep->req_handle); | 1042 | GNUNET_assert (NULL != pending_rep->req_handle); |
1043 | GNUNET_RPS_request_cancel (pending_rep->req_handle); | 1043 | GNUNET_RPS_request_cancel (pending_rep->req_handle); |
1044 | pending_rep->req_handle = NULL; | ||
1044 | GNUNET_free (pending_rep); | 1045 | GNUNET_free (pending_rep); |
1046 | pending_rep = NULL; | ||
1045 | } | 1047 | } |
1046 | 1048 | ||
1047 | void | 1049 | void |
@@ -2061,29 +2063,8 @@ profiler_eval (void) | |||
2061 | return evaluate (); | 2063 | return evaluate (); |
2062 | } | 2064 | } |
2063 | 2065 | ||
2064 | static uint32_t fac (uint32_t x) | ||
2065 | { | ||
2066 | if (1 >= x) | ||
2067 | { | ||
2068 | return x; | ||
2069 | } | ||
2070 | return x * fac (x - 1); | ||
2071 | } | ||
2072 | 2066 | ||
2073 | static uint32_t binom (uint32_t n, uint32_t k) | 2067 | /** @brief is b in view of a? |
2074 | { | ||
2075 | //GNUNET_assert (n >= k); | ||
2076 | if (k > n) return 0; | ||
2077 | /* if (0 > n) return 0; - always false */ | ||
2078 | /* if (0 > k) return 0; - always false */ | ||
2079 | if (0 == k) return 1; | ||
2080 | return fac (n) | ||
2081 | / | ||
2082 | fac(k) * fac(n - k); | ||
2083 | } | ||
2084 | |||
2085 | /** | ||
2086 | * @brief is b in view of a? | ||
2087 | * | 2068 | * |
2088 | * @param a | 2069 | * @param a |
2089 | * @param b | 2070 | * @param b |