garray: Optimise over-allocations with g_array_insert_vals()e1e800299896dd28b924e42807bca6052b4732e153/head
commite1e800299896dd28b924e42807bca6052b4732e1
authorPhilip Withnall <withnall@endlessm.com>
Mon, 4 Jun 2018 10:42:24 +0000 (4 11:42 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Mon, 4 Jun 2018 10:45:48 +0000 (4 11:45 +0100)
tree1a66f4bd7f9a8b019a84cf9ecc6bac7c9dbe2af1
parente0f82b949449d6bed857abe58c108d923f919b7c
garray: Optimise over-allocations with g_array_insert_vals()

When over-allocating by inserting values off the end of an array, maybe
expand the array once, rather than twice (once for setting the size and
once for appending the values).

Suggestion by Peter Bloomfield (@peterb) as a follow-up to #1374.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
glib/garray.c