Skip to content

Commit

Permalink
builtin/blame.c::find_copy_in_blob: no need to scan for region end
Browse files Browse the repository at this point in the history
The region end can be looked up just like its beginning.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
David Kastrup authored and Junio C Hamano committed Feb 25, 2014
1 parent 352bbbd commit 3ee8944
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions builtin/blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
Expand Down

0 comments on commit 3ee8944

Please sign in to comment.