Skip to content

Commit e08a109

Browse files
committed
more unsafe according to flamegraph.
1 parent 8807026 commit e08a109

File tree

1 file changed

+6
-2
lines changed
  • datafusion/functions-aggregate-common/src/aggregate/groups_accumulator

1 file changed

+6
-2
lines changed

datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/blocks.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,18 @@ impl<B: Block> Index<usize> for Blocks<B> {
162162

163163
#[inline]
164164
fn index(&self, index: usize) -> &Self::Output {
165-
&self.inner[index]
165+
unsafe {
166+
self.inner.get_unchecked(index)
167+
}
166168
}
167169
}
168170

169171
impl<B: Block> IndexMut<usize> for Blocks<B> {
170172
#[inline]
171173
fn index_mut(&mut self, index: usize) -> &mut Self::Output {
172-
&mut self.inner[index]
174+
unsafe {
175+
self.inner.get_unchecked_mut(index)
176+
}
173177
}
174178
}
175179

0 commit comments

Comments
 (0)