[PATCH] binary search for inexact matches

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Thu Mar 3 00:53:24 UTC 2016


hi,

This adds a form of binary search macro that, when the term is not
found, tells you the place where it would have been. In other words, it
finds the first item greater than or equal to the search term, not
unlike the Python library's "bisect.bisect_left".

There is a test. For good measure I added a test for another bisect macro.

A use for this will appear soon.

cheers,
Douglas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binsearch.patch
Type: text/x-diff
Size: 10426 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160303/797b0f92/binsearch.diff>


More information about the samba-technical mailing list