Added some `#[inline]` statements on `TransactionQueue` impl of `Vec`.

This commit is contained in:
Marc Brinkmann 2018-10-11 15:44:44 +02:00
parent 78dd3db474
commit bcb151e78d
1 changed files with 2 additions and 0 deletions

View File

@ -31,6 +31,7 @@ where
self.is_empty()
}
#[inline]
fn remove_multiple<'a, I>(&mut self, txs: I)
where
I: IntoIterator<Item = &'a T>,
@ -41,6 +42,7 @@ where
}
// TODO: Return references, once the `HoneyBadger` API accepts them. Remove `Clone` bound.
#[inline]
fn choose<R: Rng>(&mut self, rng: &mut R, amount: usize, batch_size: usize) -> Vec<T> {
let limit = cmp::min(batch_size, self.len());
let sample = match rand::seq::sample_iter(rng, self.iter().take(limit), amount) {