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

[PATCH 3/3] commit: remove commit_list_reverse()

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 25, 2012, 20:35 UTC
Message-ID
<4F98602A.7020404@lsrfire.ath.cx>
In-Reply-To
<4F985D0A.9020100@lsrfire.ath.cx>
The function commit_list_reverse() is not used anymore; delete it.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 commit.c |   15 ---------------
 commit.h |    1 -
 2 files changed, 16 deletions(-)
diff --git a/commit.c b/commit.c
index 8361acb..9ed36c7 100644
--- a/commit.c
+++ b/commit.c
@@ -361,21 +361,6 @@ struct commit_list *commit_list_insert(struct commit *item, struct commit_list *
 	return new_list;
 }
 
-void commit_list_reverse(struct commit_list **list_p)
-{
-	struct commit_list *prev = NULL, *curr = *list_p, *next;
-
-	if (!list_p)
-		return;
-	while (curr) {
-		next = curr->next;
-		curr->next = prev;
-		prev = curr;
-		curr = next;
-	}
-	*list_p = prev;
-}
-
 unsigned commit_list_count(const struct commit_list *l)
 {
 	unsigned c = 0;
diff --git a/commit.h b/commit.h
index bd17770..ccaa20b 100644
--- a/commit.h
+++ b/commit.h
@@ -59,7 +59,6 @@ unsigned commit_list_count(const struct commit_list *l);
 struct commit_list *commit_list_insert_by_date(struct commit *item,
 				    struct commit_list **list);
 void commit_list_sort_by_date(struct commit_list **list);
-void commit_list_reverse(struct commit_list **list_p);
 
 void free_commit_list(struct commit_list *list);
 
-- 
1.7.10
Previous: René Scharfe
Message 8 of 8 in “Possible segfault introduced in commit.c”
  1. Michael MuellerApr 25, 2012
  2. Jeff KingApr 25, 2012
  3. René ScharfeApr 25, 2012
  4. 1/3 sequencer: export commit_list_append()René Scharfe, Apr 25, 2012
  5. Junio C HamanoApr 25, 2012
  6. René ScharfeApr 30, 2012
  7. 2/3 revision: append to list instead of insert and reverseRené Scharfe, Apr 25, 2012
  8. 3/3 commit: remove commit_list_reverse()René Scharfe, Apr 25, 2012

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.