diff options
author | René Scharfe <l.s.r@web.de> | 2017-07-08 12:35:35 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-10 14:24:36 -0700 |
commit | 42c78a216e751cfa2720c8276c9e9f2b81640e6b (patch) | |
tree | ff12c046af74e524d80ec247f8039592337afee6 /builtin/receive-pack.c | |
parent | 8c8e978f5719c6a58fb998742207bf907f963143 (diff) | |
download | git-42c78a216e751cfa2720c8276c9e9f2b81640e6b.tar.gz |
use DIV_ROUND_UPrs/use-div-round-up
Convert code that divides and rounds up to use DIV_ROUND_UP to make the
intent clearer and reduce the number of magic constants.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r-- | builtin/receive-pack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index da9a3a2c9d..90d58c2fed 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -1805,7 +1805,7 @@ static const char *unpack_with_sideband(struct shallow_info *si) static void prepare_shallow_update(struct command *commands, struct shallow_info *si) { - int i, j, k, bitmap_size = (si->ref->nr + 31) / 32; + int i, j, k, bitmap_size = DIV_ROUND_UP(si->ref->nr, 32); ALLOC_ARRAY(si->used_shallow, si->shallow->nr); assign_shallow_commits_to_refs(si, si->used_shallow, NULL); |