Skip to content

Commit 935202b

Browse files
whydoubtgitster
authored andcommitted
blame: rename nth_line function
Functions that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1a31a2d commit 935202b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

builtin/blame.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,14 @@ static void dup_entry(struct blame_entry ***queue,
653653
*queue = &dst->next;
654654
}
655655

656-
static const char *nth_line(struct blame_scoreboard *sb, long lno)
656+
static const char *blame_nth_line(struct blame_scoreboard *sb, long lno)
657657
{
658658
return sb->final_buf + sb->lineno[lno];
659659
}
660660

661661
static const char *nth_line_cb(void *data, long lno)
662662
{
663-
return nth_line((struct blame_scoreboard *)data, lno);
663+
return blame_nth_line((struct blame_scoreboard *)data, lno);
664664
}
665665

666666
/*
@@ -968,8 +968,8 @@ static unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entr
968968
return e->score;
969969

970970
score = 1;
971-
cp = nth_line(sb, e->lno);
972-
ep = nth_line(sb, e->lno + e->num_lines);
971+
cp = blame_nth_line(sb, e->lno);
972+
ep = blame_nth_line(sb, e->lno + e->num_lines);
973973
while (cp < ep) {
974974
unsigned ch = *((unsigned char *)cp);
975975
if (isalnum(ch))
@@ -1078,9 +1078,9 @@ static void find_copy_in_blob(struct blame_scoreboard *sb,
10781078
/*
10791079
* Prepare mmfile that contains only the lines in ent.
10801080
*/
1081-
cp = nth_line(sb, ent->lno);
1081+
cp = blame_nth_line(sb, ent->lno);
10821082
file_o.ptr = (char *) cp;
1083-
file_o.size = nth_line(sb, ent->lno + ent->num_lines) - cp;
1083+
file_o.size = blame_nth_line(sb, ent->lno + ent->num_lines) - cp;
10841084

10851085
/*
10861086
* file_o is a part of final image we are annotating.
@@ -1866,7 +1866,7 @@ static void emit_porcelain(struct blame_scoreboard *sb, struct blame_entry *ent,
18661866
ent->num_lines);
18671867
emit_porcelain_details(suspect, repeat);
18681868

1869-
cp = nth_line(sb, ent->lno);
1869+
cp = blame_nth_line(sb, ent->lno);
18701870
for (cnt = 0; cnt < ent->num_lines; cnt++) {
18711871
char ch;
18721872
if (cnt) {
@@ -1900,7 +1900,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
19001900
get_commit_info(suspect->commit, &ci, 1);
19011901
oid_to_hex_r(hex, &suspect->commit->object.oid);
19021902

1903-
cp = nth_line(sb, ent->lno);
1903+
cp = blame_nth_line(sb, ent->lno);
19041904
for (cnt = 0; cnt < ent->num_lines; cnt++) {
19051905
char ch;
19061906
int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;

0 commit comments

Comments
 (0)