Skip to content

Commit f06bbdc

Browse files
joseph-isaacsclaude
andcommitted
Remove redundant VTable::child overrides
Both Patched and PythonVTable overrode VTable::child with behavior identical to the trait default: all four Patched slots are required (always Some), so the default idx-th non-None slot lookup returns exactly slots[idx], and PythonArray has no slots with nchildren() == 0, so its panicking override was unreachable behind the idx < nchildren guard in every caller. Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbjnDVZQ9KqXgAAhxy9g7D
1 parent 05c7c2f commit f06bbdc

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

  • vortex-array/src/arrays/patched/vtable
  • vortex-python/src/arrays/py

vortex-array/src/arrays/patched/vtable/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,6 @@ impl VTable for Patched {
138138
with_empty_buffers(self, array, buffers)
139139
}
140140

141-
fn child(array: ArrayView<'_, Self>, idx: usize) -> ArrayRef {
142-
match idx {
143-
PatchedSlots::INNER => array.inner().clone(),
144-
PatchedSlots::LANE_OFFSETS => array.lane_offsets().clone(),
145-
PatchedSlots::PATCH_INDICES => array.patch_indices().clone(),
146-
PatchedSlots::PATCH_VALUES => array.patch_values().clone(),
147-
_ => vortex_panic!("invalid child index for PatchedArray: {idx}"),
148-
}
149-
}
150-
151141
fn serialize(
152142
array: ArrayView<'_, Self>,
153143
_session: &VortexSession,

vortex-python/src/arrays/py/vtable.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ impl VTable for PythonVTable {
9696
0
9797
}
9898

99-
fn child(_array: ArrayView<'_, Self>, idx: usize) -> ArrayRef {
100-
vortex_panic!("PythonArray child index {idx} out of bounds")
101-
}
102-
10399
fn child_name(_array: ArrayView<'_, Self>, idx: usize) -> String {
104100
vortex_panic!("PythonArray child_name index {idx} out of bounds")
105101
}

0 commit comments

Comments
 (0)