diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-02-25 16:43:29 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-25 16:43:29 -0800 |
commit | 18decfd11d31caef89a01d721c7baa994996e096 (patch) | |
tree | 36b7d8843450a4ac356aa3c8b962d9f3768ca765 /builtin | |
parent | Merge branch 'mz/doc-notes-are-not-anchors' (diff) | |
parent | blame: remove unnecessary use of get_commit_info() (diff) | |
download | tgif-18decfd11d31caef89a01d721c7baa994996e096.tar.xz |
Merge branch 'rs/blame-optim'
Optimization in "git blame"
* rs/blame-optim:
blame: remove unnecessary use of get_commit_info()
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/blame.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index b66e938022..641523ff9a 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -425,13 +425,11 @@ static void setup_default_color_by_age(void) parse_color_fields("blue,12 month ago,white,1 month ago,red"); } -static void determine_line_heat(struct blame_entry *ent, const char **dest_color) +static void determine_line_heat(struct commit_info *ci, const char **dest_color) { int i = 0; - struct commit_info ci; - get_commit_info(ent->suspect->commit, &ci, 1); - while (i < colorfield_nr && ci.author_time > colorfield[i].hop) + while (i < colorfield_nr && ci->author_time > colorfield[i].hop) i++; *dest_color = colorfield[i].col; @@ -453,7 +451,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int cp = blame_nth_line(sb, ent->lno); if (opt & OUTPUT_SHOW_AGE_WITH_COLOR) { - determine_line_heat(ent, &default_color); + determine_line_heat(&ci, &default_color); color = default_color; reset = GIT_COLOR_RESET; } |