Closed pkerpedjiev closed 7 years ago
Yes, it seems like there's an issue. I'll take a look at the implementation when I find some spare time. A PR will also be appreciated, if you don't mind digging into the code.
Added a PR (#114) with a fix and some tests. Seems to work for me.
Looks like the max value wasn't being properly set for newly added nodes.
Great library, but I think there's a bug in the
IntervalTree
implementation. Consider the following snippet:This should logically return
true
, right? The intersection test clearly overlaps the last added interval. Running this, however, yieldsfalse
. If either of the first twoadd
statements are removed, the intersection check at the end returnstrue
as expected.