Commit cfa6c03f authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Note that pma_search might as well be written recursively. Addresses #374.

git-svn-id: file:///svn/tokudb@2237 c7de825b-a66e-492c-adef-691d508d4ae1
parent f60a2e07
...@@ -220,6 +220,7 @@ static int pma_compare_dbt_kv(PMA pma, DBT *k, DBT *v, struct kv_pair *kv) { ...@@ -220,6 +220,7 @@ static int pma_compare_dbt_kv(PMA pma, DBT *k, DBT *v, struct kv_pair *kv) {
} }
/* search the index for a matching key and maybe value */ /* search the index for a matching key and maybe value */
// this is just as fast as the iterative loop, since the compiler recognizes the tail calls.
static unsigned int pma_search(PMA pma, DBT *k, DBT *v, int lo, int hi, int *found) { static unsigned int pma_search(PMA pma, DBT *k, DBT *v, int lo, int hi, int *found) {
assert(0 <= lo && lo <= hi); assert(0 <= lo && lo <= hi);
if (lo >= hi) { if (lo >= hi) {
......
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