Hi,
On Sat Dec 07 12:14:55 2013, phin@mailnesia.com wrote:
Show quoted text> Please allow intervals of zero length, i.e. intervals with the same
> start and end point. A very practical use case for this: storing a
> bunch of timestamps and returning those in a specified interval.
Unfortunately, the underlying C++ algorithm (which I did not write) was originally designed to work on both-ends-open intervals, and doesn't support zero-length intervals (well, it accepts them but then returns incorrect results). My XS wrapper converts between the half-open intervals you supply and the both-ends-open intervals the C++ code expects. I'm sure it's possible to convert the C++ code to use half-open intervals natively, but I'm not sure if/when I will find time to work on this. I do have a github repository here:
https://github.com/benwbooth/Set-IntervalTree
So, if you're feeling adventurous you could check out the src/interval_tree.h file and see how hard it would be to do the conversion. If you make any progress, please send a pull request and I will merge it in. Any help is greatly appreciated!