On Thu, Apr 30, 2020 at 05:37:29PM +0200, Pablo Neira Ayuso wrote: > On Thu, Apr 30, 2020 at 05:14:07PM +0200, Phil Sutter wrote: > > Both functions were very similar already. Under the assumption that they > > will always either see a range (or start of) that matches exactly or not > > at all, reduce complexity and make get_set_interval_find() accept NULL > > (left or) right values. This way it becomes a full replacement for > > get_set_interval_end(). > > I have to go back to the commit log of this patch, IIRC my intention > here was to allow users to ask for a single element, then return the > range that contains it. That was my suspicion as well, but while testing I found out that no matter what I passed to 'get element', I couldn't provoke a situation in which get_set_interval_find() would have left and right elements which didn't match exactly (or not at all). There must be some preparation happening before the call to get_set_decompose() which normalizes things. And still, If I disable the call to get_set_decompose() entirely, tests start failing. Cheers, Phil