[03/10] diff: drop unused emit data parameter from sane_truncate_line()
diff mbox series

Message ID 20190214054827.GC20578@sigill.intra.peff.net
State New
Headers show
Series
  • dropping more unused function parameters
Related show

Commit Message

Jeff King Feb. 14, 2019, 5:48 a.m. UTC
We pass the "struct emit_callback" (which contains all of the context
for our diff) into sane_truncate_line(), but that function doesn't
actually use it. In theory we might eventually develop a diff option
that impacts this, but in the meantime let's not mislead anybody reading
the code. Since the function is static, it would be easy to pass it
again if it should ever become useful.

Signed-off-by: Jeff King <peff@peff.net>
---
 diff.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/diff.c b/diff.c
index de45bbd76e..d24843b531 100644
--- a/diff.c
+++ b/diff.c
@@ -2287,7 +2287,7 @@  const char *diff_line_prefix(struct diff_options *opt)
 	return msgbuf->buf;
 }
 
-static unsigned long sane_truncate_line(struct emit_callback *ecb, char *line, unsigned long len)
+static unsigned long sane_truncate_line(char *line, unsigned long len)
 {
 	const char *cp;
 	unsigned long allot;
@@ -2351,7 +2351,7 @@  static void fn_out_consume(void *priv, char *line, unsigned long len)
 	if (line[0] == '@') {
 		if (ecbdata->diff_words)
 			diff_words_flush(ecbdata);
-		len = sane_truncate_line(ecbdata, line, len);
+		len = sane_truncate_line(line, len);
 		find_lno(line, ecbdata);
 		emit_hunk_header(ecbdata, line, len);
 		return;