git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Remove redundant assignments

From
Jan Stępień <jstepien@users.sourceforge.net>
Date
Nov 27, 2011, 08:05 UTC
Message-ID
<1322381142-20645-1-git-send-email-jstepien@users.sourceforge.net>

There were two redundant variable assignments in transport.c and wt-status.c. Removing them hasn't introduced any compiler warnings or regressions.

Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>
---
 transport.c |    2 +-
 wt-status.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/transport.c b/transport.c
index 51814b5..5143718 100644
--- a/transport.c
+++ b/transport.c
@@ -105,7 +105,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
 		return;
 
 	for (;;) {
-		int cmp = cmp, len;
+		int cmp, len;
 
 		if (!fgets(buffer, sizeof(buffer), f)) {
 			fclose(f);
diff --git a/wt-status.c b/wt-status.c
index 70fdb76..35f61f4 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -229,7 +229,7 @@ static void wt_status_print_change_data(struct wt_status *s,
 {
 	struct wt_status_change_data *d = it->util;
 	const char *c = color(change_type, s);
-	int status = status;
+	int status;
 	char *one_name;
 	char *two_name;
 	const char *one, *two;
-- 
1.7.7.4
Next: Junio C Hamano
Message 1 of 2 in “Remove redundant assignments”
  1. Remove redundant assignmentsJan Stępień, Nov 27, 2011
  2. Junio C HamanoNov 27, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.