Commit 19032af4 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #288

Assumption of commutativity of cmp function is implicit.
No testing is done.

git-svn-id: file:///svn/tokudb@1990 c7de825b-a66e-492c-adef-691d508d4ae1
parent 40d65104
...@@ -146,9 +146,6 @@ int toku_rt_close(toku_range_tree* tree) { ...@@ -146,9 +146,6 @@ int toku_rt_close(toku_range_tree* tree) {
return 0; return 0;
} }
/* It is all too true that this is a worst-case linear implementation,
but great performance gains could be obtained by simply making the
list into move-to-front (see Sleator, Tarjan, CACM 1985) */
int toku_rt_find(toku_range_tree* tree, toku_range* query, unsigned k, int toku_rt_find(toku_range_tree* tree, toku_range* query, unsigned k,
toku_range** buf, unsigned* buflen, unsigned* numfound) { toku_range** buf, unsigned* buflen, unsigned* numfound) {
if (!tree || !query || !buf || !buflen || !numfound) return EINVAL; if (!tree || !query || !buf || !buflen || !numfound) return EINVAL;
...@@ -186,9 +183,6 @@ int toku_rt_insert(toku_range_tree* tree, toku_range* range) { ...@@ -186,9 +183,6 @@ int toku_rt_insert(toku_range_tree* tree, toku_range* range) {
} }
else { else {
for (i = 0; i < tree->numelements; i++) { for (i = 0; i < tree->numelements; i++) {
/* I am going to check that end_cmp is commutative as such: */
assert (__toku_rt_overlap(tree, range, &tree->ranges[i]) ==
__toku_rt_overlap(tree, &tree->ranges[i], range));
if (__toku_rt_overlap(tree, range, &tree->ranges[i])) return EDOM; if (__toku_rt_overlap(tree, range, &tree->ranges[i])) return EDOM;
} }
} }
......
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