8000 Removing redundant call to find start line. · libgit2/libgit2@3b6288a · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b6288a

Browse files
author
Tim
committed
Removing redundant call to find start line.
1 parent 3b750a8 commit 3b6288a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/libgit2/blame.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,12 @@ static git_blame_hunk *dup_hunk(git_blame_hunk *hunk, git_blame *blame)
117117
static void shift_hunks_by(git_vector *v, size_t start_line, int shift_by)
118118
{
119119
size_t i;
120-
121-
if (!git_vector_bsearch2(&i, v, hunk_byfinalline_search_cmp, &start_line)) {
122-
for (i = 0; i < v->length; i++) {
123-
git_blame_hunk *hunk = (git_blame_hunk*)v->contents[i];
124-
if(hunk->final_start_line_number < start_line){
125-
continue;
126-
}
127-
hunk->final_start_line_number += shift_by;
120+
for (i = 0; i < v->length; i++) {
121+
git_blame_hunk *hunk = (git_blame_hunk*)v->contents[i];
122+
if(hunk->final_start_line_number < start_line){
123+
continue;
128124
}
125+
hunk->final_start_line_number += shift_by;
129126
}
130127
}
131128

0 commit comments

Comments
 (0)
0