Maximum call stack size exceeded
SudoPlz opened this issue · comments
Ioannis Kokkinidis commented
I get this error when I try to create a tree with the following values:
{ id: 1, startTime: '1015', endTime: '1115'},
{ id: 2, startTime: '1025', endTime: '1120'},
{ id: 3, startTime: '1035', endTime: '1115'},
{ id: 4, startTime: '1045', endTime: '1115'},
{ id: 5, startTime: '1215', endTime: '1415'},
{ id: 6, startTime: '1135', endTime: '1515'},
{ id: 7, startTime: '0935', endTime: '1014'},
{ id: 8, startTime: '0935', endTime: '1614'},
for each child I add the values like so:
const initialTree = new IntervalTree(); // create a new interval tree
initialTree.insert(
child.startTime,
child.endTime,
child.id
);
but sometimes I have more than 1 trees ( I run the above code in multiple places)
Any ideas?
Mikola Lysenko commented
Not sure. Been a while since I've looked at this and don't have bandwidth right now to page it all back in.
Erik Blankinship commented
Looks like you were passing in zero padded strings?
passing in ints works: https://codepen.io/jedierikb/pen/YzpYEgj?editors=0010