Thread (28 messages) 28 messages, 3 authors, 2016-06-15

[PATCH v2 11/19] diffcore-order: simplify via strbuf_set()

STALE3762d

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

Simplify cases where a strbuf_reset is immediately followed by a
strbuf_add by using strbuf_set operations.

Signed-off-by: Jeremiah Mahler <redacted>
---
 diffcore-order.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/diffcore-order.c b/diffcore-order.c
index 97dd3d0..5a93971 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -63,8 +63,7 @@ static int match_order(const char *path)
 	static struct strbuf p = STRBUF_INIT;
 
 	for (i = 0; i < order_cnt; i++) {
-		strbuf_reset(&p);
-		strbuf_addstr(&p, path);
+		strbuf_setstr(&p, path);
 		while (p.buf[0]) {
 			char *cp;
 			if (!wildmatch(order[i], p.buf, 0, NULL))
-- 
2.0.0.592.gf55b190
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help