]> git.ipfire.org Git - thirdparty/git.git/commitdiff
blame: simplify 'setup_blame_bloom_data' interface
authorPhilippe Blain <levraiphilippeblain@gmail.com>
Sun, 1 Nov 2020 17:28:47 +0000 (17:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 1 Nov 2020 23:54:15 +0000 (15:54 -0800)
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>
blame.c
blame.h
builtin/blame.c

diff --git a/blame.c b/blame.c
index 2d92af53fc0c185ea48212a491009bc3c61fc30f..9156ebeafd21114e982b52ecde9f50387f869b44 100644 (file)
--- 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 e8c185c8ef68457b638ff2041151e6542841464b..38bde535b3d46461d0619bc68c852210693de571 100644 (file)
--- 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,
index 2a9f77b9190f81cbd5df48eff21e47278fcc6c30..6f7e32411a880d4cb3971ecf1c222a3a2b0da317 100644 (file)
@@ -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;