Skip to content

Commit

Permalink
blame: simplify 'setup_blame_bloom_data' interface
Browse files Browse the repository at this point in the history
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 <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
phil-blain authored and gitster committed Nov 1, 2020
1 parent 88894aa commit 3af31e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions blame.c
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions blame.h
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion builtin/blame.c
Expand Up @@ -1094,7 +1094,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
* for copies.
*/
if (!(opt & PICKAXE_BLAME_COPY))
setup_blame_bloom_data(&sb, path);
setup_blame_bloom_data(&sb);

lno = sb.num_lines;

Expand Down

0 comments on commit 3af31e8

Please sign in to comment.