Skip to content

Commit

Permalink
Use fixed size slots in OrderPreservingInterner (apache#2677)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Oct 3, 2022
1 parent da8f742 commit 598294a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arrow/src/row/interner.rs
Expand Up @@ -305,12 +305,17 @@ struct Slot {
///
#[derive(Debug, Clone)]
struct Bucket {
slots: Box<[Slot]>,
slots: Box<[Slot; 255]>,
}

impl Default for Bucket {
fn default() -> Self {
let slots = (0..255).map(|_| Slot::default()).collect::<Vec<_>>().into();
let slots = (0..255)
.map(|_| Slot::default())
.collect::<Vec<_>>()
.into_boxed_slice()
.try_into()
.unwrap();
Self { slots }
}
}
Expand Down

0 comments on commit 598294a

Please sign in to comment.