Skip to content
Commit 37756a06 authored by Philip Withnall's avatar Philip Withnall
Browse files

array: Support clearing an empty array with g_array_remove_range()

Previously, calling g_array_remove_range(array, 0, array->len) on an
empty array would result in a precondition failure in
g_array_remove_range(), as the given start index (0), was not strictly
less than the array length (0).

Allow the index to equal the array length, so that zero elements can be
removed from any array. A subsequent check makes sure that the array
length is not overflowed by the index + length.

https://bugzilla.gnome.org/show_bug.cgi?id=763339
parent 7d3d9489
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment