mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 01:58:16 +00:00
Remove premature cast to usize (cell_idx can be negative)
This commit is contained in:
parent
8ad6aadbbd
commit
cba84b7ce9
1 changed files with 2 additions and 8 deletions
|
@ -738,13 +738,7 @@ impl BTreeCursor {
|
|||
let contents = page.get().contents.as_ref().unwrap();
|
||||
|
||||
let cell_count = contents.cell_count();
|
||||
let cell_idx = self.stack.current_cell_index() as usize;
|
||||
// dbg!(
|
||||
// page.get().id,
|
||||
// self.stack.current_cell_index(),
|
||||
// self.going_upwards,
|
||||
// page.get_contents().cell_count()
|
||||
// );
|
||||
let cell_idx = self.stack.current_cell_index();
|
||||
|
||||
// If we are at the end of the page and we haven't just come back from the right child,
|
||||
// we now need to move to the rightmost child.
|
||||
|
@ -756,7 +750,7 @@ impl BTreeCursor {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if cell_idx >= cell_count {
|
||||
if cell_idx >= cell_count as i32 {
|
||||
self.stack.set_cell_index(cell_count as i32 - 1);
|
||||
} else {
|
||||
let is_index = page.is_index();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue