mirror of https://github.com/poanetwork/hbbft.git
Added some `#[inline]` statements on `TransactionQueue` impl of `Vec`.
This commit is contained in:
parent
78dd3db474
commit
bcb151e78d
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue