]> git.ipfire.org Git - thirdparty/git.git/commit - dir.c
dir: avoid allocation in fill_directory()
authorRené Scharfe <l.s.r@web.de>
Tue, 7 Feb 2017 22:04:25 +0000 (23:04 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Feb 2017 21:38:41 +0000 (13:38 -0800)
commitbec5ab8997c2391fa2241520f52f301397ebd538
tree2c1f914fd26d48deaaf5be42bd5fea5bb1ee96aa
parent6e3a7b3398559305c7a239a42e447c21a8f39ff8
dir: avoid allocation in fill_directory()

Pass the match member of the first pathspec item directly to
read_directory() instead of using common_prefix() to duplicate it first,
thus avoiding memory duplication, strlen(3) and free(3).

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c