summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-07-08 12:35:35 +0200
committerJunio C Hamano <gitster@pobox.com>2017-07-10 14:24:36 -0700
commit42c78a216e751cfa2720c8276c9e9f2b81640e6b (patch)
treeff12c046af74e524d80ec247f8039592337afee6 /builtin/grep.c
parent8c8e978f5719c6a58fb998742207bf907f963143 (diff)
downloadgit-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/grep.c')
-rw-r--r--builtin/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 254c1c7849..dc001da562 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -524,7 +524,7 @@ static void compile_submodule_options(const struct grep_opt *opt,
* submodule process has its own thread pool.
*/
argv_array_pushf(&submodule_options, "--threads=%d",
- (num_threads + 1) / 2);
+ DIV_ROUND_UP(num_threads, 2));
/* Add Pathspecs */
argv_array_push(&submodule_options, "--");