We really should specialize for extend with iterators that can be cloned. Possibly as an additional fn.
Let's check the speed of Extend w.r.t. growing.
Best to get a maximum of all elements, then grow once if needed.
impl<B: BitBlock> Extend<usize> for BitSet<B> {
#[inline]
fn extend<I: IntoIterator<Item = usize>>(&mut self, iter: I) {
for i in iter {
self.insert(i);
}
}
}
We really should specialize for extend with iterators that can be cloned. Possibly as an additional fn.
Let's check the speed of
Extend
w.r.t. growing.Best to get a maximum of all elements, then grow once if needed.