Commit 93d2d2fc authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Enable tail calls. Fixes #879.

git-svn-id: file:///svn/tokudb@4645 c7de825b-a66e-492c-adef-691d508d4ae1
parent 89307e29
......@@ -172,9 +172,9 @@ static inline void rebuild_from_sorted_array(OMT omt, node_idx *n_idxp,
OMT_NODE newnode = omt->i.t.nodes+newidx;
newnode->weight = numvalues;
newnode->value = values[halfway];
*n_idxp = newidx; // update everything before the recursive calls so the second call can be a tail call.
rebuild_from_sorted_array(omt, &newnode->left, values, halfway);
rebuild_from_sorted_array(omt, &newnode->right, values+halfway+1, numvalues-(halfway+1));
*n_idxp = newidx;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment