git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: apodtele <apodtele@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH 2/2] diff --stat: clean up unused code
Date: Thu, 12 Oct 2006 15:40:55 -0400	[thread overview]
Message-ID: <d620685f0610121240h85d7a6eq2e3a2cf66a7643c5@mail.gmail.com> (raw)

Clean up unused code.

Signed-off-by: Alexei Podtelezhnikov

--- diff.c	2006-10-12 15:07:30.000000000 -0400
+++ diff.c	2006-10-12 15:17:15.000000000 -0400
@@ -660,8 +660,8 @@

 static void show_stats(struct diffstat_t* data, struct diff_options *options)
 {
-	int i, len, add, del, total, adds = 0, dels = 0;
-	int max_change = 0, max_len = 0;
+	int i, len, add, del, adds = 0, dels = 0;
+	int max_len = 0;
 	int total_files = data->nr;
 	int width, name_width;
 	const char *reset, *set, *add_c, *del_c;
@@ -706,8 +706,6 @@

 		if (file->is_binary || file->is_unmerged)
 			continue;
-		if (max_change < change)
-			max_change = change;
 	}

 	/* Compute the width of the graph part;
@@ -718,10 +716,7 @@
 	 * and width is the width of the graph area.
 	 */
 	name_width = (name_width < max_len) ? name_width : max_len;
-	if (width < (name_width + 10) + max_change)
-		width = width - (name_width + 10);
-	else
-		width = max_change;
+	width = width - (name_width + 10);

 	for (i = 0; i < data->nr; i++) {
 		const char *prefix = "";
@@ -766,13 +761,11 @@
 		 */
 		add = added;
 		del = deleted;
-		total = add + del;
 		adds += add;
 		dels += del;

 		add = scale_nonlinear(add, width / 2);
 		del = scale_nonlinear(del, width / 2);
-		total = add + del;
 		show_name(prefix, name, len, reset, set);
 		printf("%5d ", added + deleted);
 		show_graph('+', add, add_c, reset);

                 reply	other threads:[~2006-10-12 19:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d620685f0610121240h85d7a6eq2e3a2cf66a7643c5@mail.gmail.com \
    --to=apodtele@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).