]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.h
ref-filter: factor ref_array pushing into its own function
authorJeff King <peff@peff.net>
Fri, 6 Apr 2018 18:59:45 +0000 (14:59 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Apr 2018 21:14:46 +0000 (06:14 +0900)
commit427cbc9dbfeb7c96bb1d5d9ace722353e2a5438e
tree744ac05e882b68aefcaabc345a28672effb08c12
parent0ffaa00f453978bffc4ff0f8a45ea0a52549e7cd
ref-filter: factor ref_array pushing into its own function

In preparation for callers constructing their own ref_array
structs, let's move our own internal push operation into its
own function.

While we're at it, we can replace REALLOC_ARRAY() with
ALLOC_GROW(), which should give the growth operation
amortized linear complexity (as opposed to growing by one,
which is potentially quadratic, though in-place realloc
growth often makes this faster in practice).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c
ref-filter.h