Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH 13/23] builtin-remote: remove unused code in get_ref_states

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:16
Subsystem: the rest · Maintainer: Linus Torvalds

get_ref_states() populates the util pointer of the string_list_item's
that it adds to states->new and states->tracked, but nothing ever uses
the pointer, so we can get rid of the extra code.

Signed-off-by: Jay Soffian <redacted>
---
 builtin-remote.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/builtin-remote.c b/builtin-remote.c
index d5c808c..56d73c8 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -251,18 +251,11 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
 
 	states->new.strdup_strings = states->tracked.strdup_strings = 1;
 	for (ref = fetch_map; ref; ref = ref->next) {
-		struct string_list *target = &states->tracked;
 		unsigned char sha1[20];
-		void *util = NULL;
-
 		if (!ref->peer_ref || read_ref(ref->peer_ref->name, sha1))
-			target = &states->new;
-		else {
-			target = &states->tracked;
-			if (hashcmp(sha1, ref->new_sha1))
-				util = &states;
-		}
-		string_list_append(abbrev_branch(ref->name), target)->util = util;
+			string_list_append(abbrev_branch(ref->name), &states->new);
+		else
+			string_list_append(abbrev_branch(ref->name), &states->tracked);
 	}
 	free_refs(fetch_map);
 
-- 
1.6.2.rc1.291.g83eb
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help