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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Smith committed May 24, 2017 at 00:15 UTC 935202bdf427f6dafa7ba013af92e4b6374a1c1b
1 file changed +8 -8
builtin/blame.c
+8 -8
@@ -653,14 +653,14 @@ static void dup_entry(struct blame_entry ***queue,
653 *queue = &dst->next;
654 }
655
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)
657 {
658 return sb->final_buf + sb->lineno[lno];
659 }
660
661 static const char *nth_line_cb(void *data, long lno)
662 {
663 - return nth_line((struct blame_scoreboard *)data, lno);
663 + return blame_nth_line((struct blame_scoreboard *)data, lno);
664 }
665
666 /*
@@ -968,8 +968,8 @@ static unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entr
968 return e->score;
969
970 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);
973 while (cp < ep) {
974 unsigned ch = *((unsigned char *)cp);
975 if (isalnum(ch))
@@ -1078,9 +1078,9 @@ static void find_copy_in_blob(struct blame_scoreboard *sb,
1078 /*
1079 * Prepare mmfile that contains only the lines in ent.
1080 */
1081 - cp = nth_line(sb, ent->lno);
1081 + cp = blame_nth_line(sb, ent->lno);
1082 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;
1084
1085 /*
1086 * 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,
1866 ent->num_lines);
1867 emit_porcelain_details(suspect, repeat);
1868
1869 - cp = nth_line(sb, ent->lno);
1869 + cp = blame_nth_line(sb, ent->lno);
1870 for (cnt = 0; cnt < ent->num_lines; cnt++) {
1871 char ch;
1872 if (cnt) {
@@ -1900,7 +1900,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
1900 get_commit_info(suspect->commit, &ci, 1);
1901 oid_to_hex_r(hex, &suspect->commit->object.oid);
1902
1903 - cp = nth_line(sb, ent->lno);
1903 + cp = blame_nth_line(sb, ent->lno);
1904 for (cnt = 0; cnt < ent->num_lines; cnt++) {
1905 char ch;
1906 int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? GIT_SHA1_HEXSZ : abbrev;