Skip to content

Commit

Permalink
CombinationsWithReplacement: use a boxed slice internally
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet authored and phimuemue committed Jan 25, 2024
1 parent 8dd75f1 commit a0411d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/combinations_with_replacement.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloc::boxed::Box;
use alloc::vec::Vec;
use std::fmt;
use std::iter::FusedIterator;
Expand All @@ -16,7 +17,7 @@ where
I: Iterator,
I::Item: Clone,
{
indices: Vec<usize>,
indices: Box<[usize]>,
pool: LazyBuffer<I>,
first: bool,
}
Expand Down Expand Up @@ -46,7 +47,7 @@ where
I: Iterator,
I::Item: Clone,
{
let indices: Vec<usize> = alloc::vec![0; k];
let indices = alloc::vec![0; k].into_boxed_slice();
let pool: LazyBuffer<I> = LazyBuffer::new(iter);

CombinationsWithReplacement {
Expand Down

0 comments on commit a0411d6

Please sign in to comment.