Skip to content

Commit a21bf64

Browse files
committed
Correct capacity logic
1 parent da18a35 commit a21bf64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/columnar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ mod builder {
306306
let words = self.current.borrow().length_in_words();
307307
let round = (words + ((1 << 18) - 1)) & !((1 << 18) - 1);
308308
if round - words < round / 10 {
309-
let mut alloc = Vec::with_capacity(8 * words);
309+
let mut alloc = Vec::with_capacity(words);
310310
columnar::bytes::serialization::encode(&mut alloc, self.current.borrow().as_bytes());
311311
self.pending.push_back(Column::Align(alloc.into_boxed_slice()));
312312
self.current.clear();
@@ -343,7 +343,7 @@ mod builder {
343343
if !self.current.is_empty() {
344344
use columnar::Container;
345345
let words = self.current.borrow().length_in_words();
346-
let mut alloc = Vec::with_capacity(8 * words);
346+
let mut alloc = Vec::with_capacity(words);
347347
columnar::bytes::serialization::encode(&mut alloc, self.current.borrow().as_bytes());
348348
self.pending.push_back(Column::Align(alloc.into_boxed_slice()));
349349
self.current.clear();

0 commit comments

Comments
 (0)