blame: inline one-line function into its lone caller

As of 25ed3412 (Refactor parse_loc; 2013-03-28), blame.c:prepare_blame_range() became effectively a one-line function which merely passes its arguments along to another function. This indirection does not bring clarity to the code. Simplify by inlining prepare_blame_range() into its lone caller. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Aug 6, 2013 at 09:59 UTC 753935749f21b10b306bc81559bba2912a7128a6
1 file changed +3 -14
builtin/blame.c
+3 -14
@@ -1937,18 +1937,6 @@ static const char *add_prefix(const char *prefix, const char *path)
1937 return prefix_path(prefix, prefix ? strlen(prefix) : 0, path);
1938 }
1939
1940 -/*
1941 - * Parsing of -L option
1942 - */
1943 -static void prepare_blame_range(struct scoreboard *sb,
1944 - const char *bottomtop,
1945 - long lno,
1946 - long *bottom, long *top)
1947 -{
1948 - if (parse_range_arg(bottomtop, nth_line_cb, sb, lno, bottom, top, sb->path))
1949 - usage(blame_usage);
1950 -}
1951 -
1940 static int git_blame_config(const char *var, const char *value, void *cb)
1941 {
1942 if (!strcmp(var, "blame.showroot")) {
@@ -2493,8 +2481,9 @@ parse_done:
2481 lno = prepare_lines(&sb);
2482
2483 bottom = top = 0;
2496 - if (bottomtop)
2497 - prepare_blame_range(&sb, bottomtop, lno, &bottom, &top);
2484 + if (bottomtop && parse_range_arg(bottomtop, nth_line_cb, &sb, lno,
2485 + &bottom, &top, sb.path))
2486 + usage(blame_usage);
2487 if (lno < top || ((lno || bottom) && lno < bottom))
2488 die("file %s has only %lu lines", path, lno);
2489 if (bottom < 1)