Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small range raises stack overflow #12

Open
yamsellem opened this issue Jul 9, 2015 · 0 comments
Open

Small range raises stack overflow #12

yamsellem opened this issue Jul 9, 2015 · 0 comments

Comments

@yamsellem
Copy link

Changing the readme example to:

var Tree = require('interval-tree');
var itree = new Tree(300);
itree.add([22, 43, 'foo']);

Will raise a Maximum call stack size exceeded in SortedList.js:26:17.
Is there something wrong with this code?

ps. [email protected]

@yamsellem yamsellem changed the title Small range raise stack overflow Small range raises stack overflow Jul 9, 2015
azhao12345 referenced this issue Aug 2, 2015
In function _insert(), the midpoint of the interval was incorrectly
calculated for left-hand traversal as (itvl.start + itvl.end / 2). This
causes infinite recursion whenever a node is inserted below a parent
where (itvl.end < idx) and (itvl.end < 2 * itvl.start).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant