Thread (15 messages) flat view 15 messages, 3 authors, 2016-06-15
STALE3728d

Revision v3 of 2 in this series.

Revisions (2)
  1. v3 current
  2. v5 [diff vs current]

[PATCH v3 2/5] tree-walk.c: remove name_compare() function

From: Jeremiah Mahler <hidden>
Date: 2016-06-15 23:01:40
Subsystem: the rest · Maintainer: Linus Torvalds

Remove the duplicate name_compare() function and use the one provided by
read-cache.c.

Signed-off-by: Jeremiah Mahler <redacted>
---

Notes:
    There is one small difference between the old function and the new one.
    The old one returned -N and +N whereas the new one returns -1 and +1.
    However, there is no place where the magnitude was needed, so this
    change will not alter its behavior.

 tree-walk.c | 10 ----------
 1 file changed, 10 deletions(-)
diff --git a/tree-walk.c b/tree-walk.c
index 4dc86c7..5dd9a71 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -144,16 +144,6 @@ struct tree_desc_x {
 	struct tree_desc_skip *skip;
 };
 
-static int name_compare(const char *a, int a_len,
-			const char *b, int b_len)
-{
-	int len = (a_len < b_len) ? a_len : b_len;
-	int cmp = memcmp(a, b, len);
-	if (cmp)
-		return cmp;
-	return (a_len - b_len);
-}
-
 static int check_entry_match(const char *a, int a_len, const char *b, int b_len)
 {
 	/*
-- 
2.0.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help