From e04e8965d95b5e2e8331140e204b578cdb2d74ba Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 8 Oct 2015 11:54:50 +0000 Subject: -make code nicer --- src/set/gnunet-service-set_union_strata_estimator.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/set') diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c index ad1dda100..59d81e134 100644 --- a/src/set/gnunet-service-set_union_strata_estimator.c +++ b/src/set/gnunet-service-set_union_strata_estimator.c @@ -47,8 +47,8 @@ size_t strata_estimator_write (const struct StrataEstimator *se, void *buf) { + char *sbuf = buf; unsigned int i; - void *sbuf = buf; size_t osize; GNUNET_assert (NULL != se); @@ -57,8 +57,7 @@ strata_estimator_write (const struct StrataEstimator *se, ibf_write_slice (se->strata[i], 0, se->ibf_size, - buf); - buf += se->ibf_size * IBF_BUCKET_SIZE; + &sbuf[se->ibf_size * IBF_BUCKET_SIZE * i]); } osize = se->ibf_size * IBF_BUCKET_SIZE * se->strata_count; #if FAIL_10_1_COMPATIBILTIY @@ -67,12 +66,12 @@ strata_estimator_write (const struct StrataEstimator *se, size_t nsize; if (GNUNET_YES == - GNUNET_try_compression (sbuf, + GNUNET_try_compression (buf, osize, &cbuf, &nsize)) { - memcpy (sbuf, cbuf, nsize); + memcpy (buf, cbuf, nsize); osize = nsize; GNUNET_free (cbuf); } -- cgit v1.2.3