Remove unused imports and consolidate ordering comparison

This commit is contained in:
PThorpe92 2025-03-30 16:29:06 -04:00
parent e020ba3dfe
commit 2c3fd509fe
No known key found for this signature in database
GPG key ID: 66DB3FBACBDD05CC
2 changed files with 4 additions and 6 deletions

View file

@ -2017,6 +2017,8 @@ impl BTreeCursor {
{
BTreeCell::IndexInteriorCell(IndexInteriorCell { payload, .. })
| BTreeCell::IndexLeafCell(IndexLeafCell { payload, .. }) => {
// TODO: implement efficient comparison of records
// e.g. https://github.com/sqlite/sqlite/blob/master/src/vdbeaux.c#L4719
read_record(
payload,
self.get_immutable_record_or_create().as_mut().unwrap(),
@ -2027,10 +2029,7 @@ impl BTreeCursor {
self.get_immutable_record().as_ref().unwrap().get_values(),
);
match order {
Ordering::Less => {
break;
}
Ordering::Equal => {
Ordering::Less | Ordering::Equal => {
break;
}
Ordering::Greater => {}
@ -2044,7 +2043,7 @@ impl BTreeCursor {
}
pub fn seek_end(&mut self) -> Result<CursorResult<()>> {
assert!(self.mv_cursor.is_none());
assert!(self.mv_cursor.is_none()); // unsure about this -_-
self.move_to_root();
loop {
let mem_page = self.stack.top();

View file

@ -7,7 +7,6 @@ use crate::translate::ProgramBuilderOpts;
use crate::translate::QueryMode;
use crate::util::PRIMARY_KEY_AUTOMATIC_INDEX_NAME_PREFIX;
use crate::vdbe::builder::CursorType;
use crate::vdbe::insn::RegisterOrLiteral;
use crate::vdbe::insn::{CmpInsFlags, Insn};
use crate::LimboError;
use crate::{bail_parse_error, Result};