Commit ce70227f authored by matt@zope.com's avatar matt@zope.com

Patch BTree_findRangeEnd to check the next bucket on a miss on the current

bucket when doing a "low" search.
parent cfa60a7a
......@@ -83,7 +83,7 @@
****************************************************************************/
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.18 2001/08/13 19:03:10 andreasjung Exp $\n"
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.19 2001/09/12 20:47:17 matt Exp $\n"
/*
** _BTree_get
......@@ -929,9 +929,20 @@ BTree_findRangeEnd(BTree *self, PyObject *keyarg, int low,
}
else
{
*bucket = BUCKET(self->data[min].value);
if ((i=Bucket_findRangeEnd(*bucket, keyarg, low, offset)))
Py_INCREF(*bucket);
i = 0;
/* Because we might miss on a range search where max=len */
while(i == 0) {
*bucket = BUCKET(self->data[min].value);
i=Bucket_findRangeEnd(*bucket, keyarg, low, offset);
if (i)
{
Py_INCREF(*bucket);
break;
}
/* if we missed, on low search, go to next bucket */
else if (low && i == 0 && min+1 < self->len) min++;
else break;
}
}
return i;
......
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