author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 18 Oct 2008 08:41:33 +0000 (10:41 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 18 Oct 2008 13:53:47 +0000 (06:53 -0700) | ||
commit | b0b44bc7b26c8c4b4221a377ce6ba174b843cb8d | |
tree | 511f98f4017d7ce38a775dfecaa91abb7b8b532f | tree | snapshot |
parent | 8009768e89dfe389327654cf9d6868f680ef1f40 | commit | diff |
use alloc_ref_from_str() everywhere
Replace pairs of alloc_ref() and strcpy() with alloc_ref_from_str(),
simplifying the code.
In connect.c, also a pair of alloc_ref() and memcpy() is replaced --
the additional cost of a strlen() call should not have too much of an
impact. Consistency and simplicity are more important.
In remote.c, the code was allocating 11 bytes more than needed for
the name part, but I couldn't see them being used for anything.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Replace pairs of alloc_ref() and strcpy() with alloc_ref_from_str(),
simplifying the code.
In connect.c, also a pair of alloc_ref() and memcpy() is replaced --
the additional cost of a strlen() call should not have too much of an
impact. Consistency and simplicity are more important.
In remote.c, the code was allocating 11 bytes more than needed for
the name part, but I couldn't see them being used for anything.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c | diff | blob | history | |
remote.c | diff | blob | history | |
transport.c | diff | blob | history |