change to use bt_cur as bt_search does
SCCS-vsn: lib/libc/db/btree/bt_put.c 8.3
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_put.c 8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)bt_put.c 8.3 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
const DBT *key, *data;
int *exactp;
{
const DBT *key, *data;
int *exactp;
{
PAGE *h;
size_t nbytes;
int cmp;
PAGE *h;
size_t nbytes;
int cmp;
t->bt_order = NOT;
return (NULL);
}
t->bt_order = NOT;
return (NULL);
}
- e.page = h;
- e.index = t->bt_last.index;
+ t->bt_cur.page = h;
+ t->bt_cur.index = t->bt_last.index;
/*
* If won't fit in this page or have too many keys in this page, have
/*
* If won't fit in this page or have too many keys in this page, have
goto miss;
if (t->bt_order == FORWARD) {
goto miss;
if (t->bt_order == FORWARD) {
- if (e.page->nextpg != P_INVALID)
+ if (t->bt_cur.page->nextpg != P_INVALID)
- if (e.index != NEXTINDEX(h) - 1)
+ if (t->bt_cur.index != NEXTINDEX(h) - 1)
- if ((cmp = __bt_cmp(t, key, &e)) < 0)
+ if ((cmp = __bt_cmp(t, key, &t->bt_cur)) < 0)
- t->bt_last.index = cmp ? ++e.index : e.index;
+ t->bt_last.index = cmp ? ++t->bt_cur.index : t->bt_cur.index;
- if (e.page->prevpg != P_INVALID)
+ if (t->bt_cur.page->prevpg != P_INVALID)
+ if (t->bt_cur.index != 0)
- if ((cmp = __bt_cmp(t, key, &e)) > 0)
+ if ((cmp = __bt_cmp(t, key, &t->bt_cur)) > 0)
goto miss;
t->bt_last.index = 0;
}
goto miss;
t->bt_last.index = 0;
}
#ifdef STATISTICS
++bt_cache_hit;
#endif
#ifdef STATISTICS
++bt_cache_hit;
#endif