From 6e7db361210149c05dee52fee58ae3ab8de08165 Mon Sep 17 00:00:00 2001 From: jussisaurio Date: Sun, 6 Oct 2024 00:58:32 +0300 Subject: [PATCH] reorder --- core/storage/btree.rs | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/core/storage/btree.rs b/core/storage/btree.rs index d67588f5d..4b568d8b5 100644 --- a/core/storage/btree.rs +++ b/core/storage/btree.rs @@ -1386,28 +1386,6 @@ impl Cursor for BTreeCursor { } } - fn seek_ge_index(&mut self, key: &OwnedRecord) -> Result> { - match self.seek(SeekKey::IndexKey(key), SeekOp::GE)? { - CursorResult::Ok((rowid, record)) => { - self.rowid.replace(rowid); - self.record.replace(record); - Ok(CursorResult::Ok(rowid.is_some())) - } - CursorResult::IO => Ok(CursorResult::IO), - } - } - - fn seek_gt_index(&mut self, key: &OwnedRecord) -> Result> { - match self.seek(SeekKey::IndexKey(key), SeekOp::GT)? { - CursorResult::Ok((rowid, record)) => { - self.rowid.replace(rowid); - self.record.replace(record); - Ok(CursorResult::Ok(rowid.is_some())) - } - CursorResult::IO => Ok(CursorResult::IO), - } - } - fn seek_ge_rowid(&mut self, rowid: u64) -> Result> { match self.seek(SeekKey::TableRowId(rowid), SeekOp::GE)? { CursorResult::Ok((rowid, record)) => { @@ -1430,6 +1408,28 @@ impl Cursor for BTreeCursor { } } + fn seek_ge_index(&mut self, key: &OwnedRecord) -> Result> { + match self.seek(SeekKey::IndexKey(key), SeekOp::GE)? { + CursorResult::Ok((rowid, record)) => { + self.rowid.replace(rowid); + self.record.replace(record); + Ok(CursorResult::Ok(rowid.is_some())) + } + CursorResult::IO => Ok(CursorResult::IO), + } + } + + fn seek_gt_index(&mut self, key: &OwnedRecord) -> Result> { + match self.seek(SeekKey::IndexKey(key), SeekOp::GT)? { + CursorResult::Ok((rowid, record)) => { + self.rowid.replace(rowid); + self.record.replace(record); + Ok(CursorResult::Ok(rowid.is_some())) + } + CursorResult::IO => Ok(CursorResult::IO), + } + } + fn record(&self) -> Result>> { Ok(self.record.borrow()) }