Skip to content

Commit 3af31e8

Browse files
phil-blaingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88894aa commit 3af31e8

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

blame.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,8 +2887,7 @@ struct blame_entry *blame_entry_prepend(struct blame_entry *head,
28872887
return new_head;
28882888
}
28892889

2890-
void setup_blame_bloom_data(struct blame_scoreboard *sb,
2891-
const char *path)
2890+
void setup_blame_bloom_data(struct blame_scoreboard *sb)
28922891
{
28932892
struct blame_bloom_data *bd;
28942893
struct bloom_filter_settings *bs;
@@ -2908,7 +2907,7 @@ void setup_blame_bloom_data(struct blame_scoreboard *sb,
29082907
bd->nr = 0;
29092908
ALLOC_ARRAY(bd->keys, bd->alloc);
29102909

2911-
add_bloom_key(bd, path);
2910+
add_bloom_key(bd, sb->path);
29122911

29132912
sb->bloom_data = bd;
29142913
}

blame.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ const char *blame_nth_line(struct blame_scoreboard *sb, long lno);
182182
void init_scoreboard(struct blame_scoreboard *sb);
183183
void setup_scoreboard(struct blame_scoreboard *sb,
184184
struct blame_origin **orig);
185-
void setup_blame_bloom_data(struct blame_scoreboard *sb,
186-
const char *path);
185+
void setup_blame_bloom_data(struct blame_scoreboard *sb);
187186
void cleanup_scoreboard(struct blame_scoreboard *sb);
188187

189188
struct blame_entry *blame_entry_prepend(struct blame_entry *head,

builtin/blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
10941094
* for copies.
10951095
*/
10961096
if (!(opt & PICKAXE_BLAME_COPY))
1097-
setup_blame_bloom_data(&sb, path);
1097+
setup_blame_bloom_data(&sb);
10981098

10991099
lno = sb.num_lines;
11001100

0 commit comments

Comments
 (0)