From 13a120530edbc98b87631423944e62997eecb464 Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou <30913090+pereman2@users.noreply.github.com> Date: Wed, 14 May 2025 13:20:11 +0200 Subject: [PATCH] comment shift_cells_left Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- core/storage/btree.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/storage/btree.rs b/core/storage/btree.rs index a6afa8223..4d4ecec4c 100644 --- a/core/storage/btree.rs +++ b/core/storage/btree.rs @@ -4683,6 +4683,17 @@ fn edit_page( Ok(()) } +/// Shifts the cell pointers in the B-tree page to the left by a specified number of positions. +/// +/// # Parameters +/// - `page`: A mutable reference to the `PageContent` representing the B-tree page. +/// - `count_cells`: The total number of cells currently in the page. +/// - `number_to_shift`: The number of cell pointers to shift to the left. +/// +/// # Behavior +/// This function modifies the cell pointer array within the page by copying memory regions. +/// It shifts the pointers starting from `number_to_shift` to the beginning of the array, +/// effectively removing the first `number_to_shift` pointers. fn shift_cells_left(page: &mut PageContent, count_cells: usize, number_to_shift: usize) { let buf = page.as_ptr(); let (start, _) = page.cell_pointer_array_offset_and_size();