Skip to content

Commit

Permalink
Correct capacity logic
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmcsherry committed Dec 27, 2024
1 parent da18a35 commit a21bf64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/columnar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ mod builder {
let words = self.current.borrow().length_in_words();
let round = (words + ((1 << 18) - 1)) & !((1 << 18) - 1);
if round - words < round / 10 {
let mut alloc = Vec::with_capacity(8 * words);
let mut alloc = Vec::with_capacity(words);
columnar::bytes::serialization::encode(&mut alloc, self.current.borrow().as_bytes());
self.pending.push_back(Column::Align(alloc.into_boxed_slice()));
self.current.clear();
Expand Down Expand Up @@ -343,7 +343,7 @@ mod builder {
if !self.current.is_empty() {
use columnar::Container;
let words = self.current.borrow().length_in_words();
let mut alloc = Vec::with_capacity(8 * words);
let mut alloc = Vec::with_capacity(words);
columnar::bytes::serialization::encode(&mut alloc, self.current.borrow().as_bytes());
self.pending.push_back(Column::Align(alloc.into_boxed_slice()));
self.current.clear();
Expand Down

0 comments on commit a21bf64

Please sign in to comment.