From: Volker Lendecke Date: Wed, 10 Aug 2011 17:52:40 +0000 (+0200) Subject: tally: Adapt tally_approx_median to Samba coding conventions X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=e31e88bc5b7c2a018323e80f5662cf82a2c39660 tally: Adapt tally_approx_median to Samba coding conventions (Imported from SAMBA commit 35550ba641d251a2dc3762b08eda92d0f7ce6bed) --- diff --git a/ccan/tally/tally.c b/ccan/tally/tally.c index 936b5142..20e99dcb 100644 --- a/ccan/tally/tally.c +++ b/ccan/tally/tally.c @@ -386,8 +386,9 @@ ssize_t tally_approx_median(const struct tally *tally, size_t *err) for (i = 0; i < tally->buckets; i++) { total += tally->counts[i]; - if (total * 2 >= count) + if (total * 2 >= count) { break; + } } return bucket_range(tally, i, err); }