B:BD[
4.68948] → [
4.68948:69343]
B:BD[
4.69343] → [
5.35301:35383]
∅:D[
5.35383] → [
4.69416:69743]
B:BD[
4.69416] → [
4.69416:69743]
B:BD[
4.69743] → [
5.35384:35439]
∅:D[
5.35439] → [
4.69804:70012]
B:BD[
4.69804] → [
4.69804:70012]
B:BD[
4.70012] → [
5.35440:35524]
∅:D[
5.35524] → [
4.70087:70218]
B:BD[
4.70087] → [
4.70087:70218]
B:BD[
4.70218] → [
5.35525:35603]
∅:D[
5.35603] → [
4.70287:70442]
B:BD[
4.70287] → [
4.70287:70442]
if self.pointer == 0 {
return Ok(None);
} else {
let current = unsafe { &mut *self.stack[self.pointer].as_mut_ptr() };
if let Some(ref mut c) = current.cursor {
// We're inside the page, and have already
// processed the left child of the current page
// cursor.
if let Some((k, v, r)) = P::next(current.page.as_page(), c) {
if r > 0 {
self.pointer += 1;
self.stack[self.pointer] = MaybeUninit::new(PageCursor {
page: txn.load_page(r)?,
cursor: None,
})
}
return Ok(Some((& *k, & *v)));
} else if self.pointer > 1 {
self.pointer -= 1
} else {
return Ok(None);
}
} else {
current.cursor = Some(P::first_cursor(current.page.as_page()));
// First element of a page (not a binding).
let cursor = current.cursor.as_ref().unwrap();
let left = P::left_child(current.page.as_page(), cursor);
debug!("left = {:?}", left);
// Then visit the right child (if any), i.e. push.
if left != 0 {
let current = unsafe { &mut *self.stack[self.pointer].as_mut_ptr() };
if let Some(ref mut c) = current.cursor {
// We're inside the page, and have already
// processed the left child of the current page
// cursor.
if let Some((k, v, r)) = P::next(current.page.as_page(), c) {
if r > 0 {