提交 3ee8944f 编写于 作者: D David Kastrup 提交者: Junio C Hamano

builtin/blame.c::find_copy_in_blob: no need to scan for region end

The region end can be looked up just like its beginning.
Signed-off-by: NDavid Kastrup <dak@gnu.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 352bbbd9
......@@ -923,7 +923,6 @@ static void find_copy_in_blob(struct scoreboard *sb,
mmfile_t *file_p)
{
const char *cp;
int cnt;
mmfile_t file_o;
struct handle_split_cb_data d;
......@@ -934,13 +933,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
*/
cp = nth_line(sb, ent->lno);
file_o.ptr = (char *) cp;
cnt = ent->num_lines;
while (cnt && cp < sb->final_buf + sb->final_buf_size) {
if (*cp++ == '\n')
cnt--;
}
file_o.size = cp - file_o.ptr;
file_o.size = nth_line(sb, ent->lno + ent->num_lines) - cp;
/*
* file_o is a part of final image we are annotating.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册