summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 357af14)
raw | patch | inline | side by side (parent: 357af14)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 17 Nov 2008 15:54:07 +0000 (07:54 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 17 Nov 2008 15:54:07 +0000 (07:54 -0800) |
We know that the string pointed at by remote->name won't change. It can
be borrowed as the key in the string_list without copying. Other parts of
existing code such as get_one_entry() already rely on this fact.
Noticed by Cheng Renquan.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
be borrowed as the key in the string_list without copying. Other parts of
existing code such as get_one_entry() already rely on this fact.
Noticed by Cheng Renquan.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-remote.c | patch | blob | history |
diff --git a/builtin-remote.c b/builtin-remote.c
index d032f25358e6c6c02ecdfc77bee5c240fb08c40a..14774e36c40cb079b52259b300cb58f6b94d0588 100644 (file)
--- a/builtin-remote.c
+++ b/builtin-remote.c
{
struct string_list *list = priv;
if (!remote->skip_default_update)
- string_list_append(xstrdup(remote->name), list);
+ string_list_append(remote->name, list);
return 0;
}