From 3af31e87868d46363359148db5243f46d49029e8 Mon Sep 17 00:00:00 2001 From: Philippe Blain Date: Sun, 1 Nov 2020 17:28:47 +0000 Subject: [PATCH] blame: simplify 'setup_blame_bloom_data' interface The penultimate commit moved the initialization of 'sb.path' in 'builtin/blame.c::cmd_blame' before the call to 'blame.c::setup_blame_bloom_data'. Since 'cmd_blame' is the only caller of 'setup_blame_bloom_data', it is now unnecessary for 'setup_blame_bloom_data' to receive 'path' as a separate argument, as 'sb.path' is already initialized. Remove this argument from setup_blame_bloom_data's interface and use the 'path' field of the 'sb' 'struct blame_scoreboard' instead. Signed-off-by: Philippe Blain Signed-off-by: Junio C Hamano --- blame.c | 5 ++--- blame.h | 3 +-- builtin/blame.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/blame.c b/blame.c index 2d92af53fc..9156ebeafd 100644 --- a/blame.c +++ b/blame.c @@ -2887,8 +2887,7 @@ struct blame_entry *blame_entry_prepend(struct blame_entry *head, return new_head; } -void setup_blame_bloom_data(struct blame_scoreboard *sb, - const char *path) +void setup_blame_bloom_data(struct blame_scoreboard *sb) { struct blame_bloom_data *bd; struct bloom_filter_settings *bs; @@ -2908,7 +2907,7 @@ void setup_blame_bloom_data(struct blame_scoreboard *sb, bd->nr = 0; ALLOC_ARRAY(bd->keys, bd->alloc); - add_bloom_key(bd, path); + add_bloom_key(bd, sb->path); sb->bloom_data = bd; } diff --git a/blame.h b/blame.h index e8c185c8ef..38bde535b3 100644 --- a/blame.h +++ b/blame.h @@ -182,8 +182,7 @@ const char *blame_nth_line(struct blame_scoreboard *sb, long lno); void init_scoreboard(struct blame_scoreboard *sb); void setup_scoreboard(struct blame_scoreboard *sb, struct blame_origin **orig); -void setup_blame_bloom_data(struct blame_scoreboard *sb, - const char *path); +void setup_blame_bloom_data(struct blame_scoreboard *sb); void cleanup_scoreboard(struct blame_scoreboard *sb); struct blame_entry *blame_entry_prepend(struct blame_entry *head, diff --git a/builtin/blame.c b/builtin/blame.c index 2a9f77b919..6f7e32411a 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -1094,7 +1094,7 @@ parse_done: * for copies. */ if (!(opt & PICKAXE_BLAME_COPY)) - setup_blame_bloom_data(&sb, path); + setup_blame_bloom_data(&sb); lno = sb.num_lines;