perf: avoid bounds check

pull/24376/head
Edd Robinson 2020-07-03 15:04:57 +01:00
parent 2be6385ade
commit 95cc07409d
1 changed files with 3 additions and 3 deletions

View File

@ -468,10 +468,10 @@ fn refill_value_pair_buffer(
blocks: &mut BTreeMap<String, BlockData>,
dst: &mut Vec<Option<ValuePair>>,
) {
for (i, block) in blocks.values_mut().enumerate() {
if dst[i].is_none() {
for (block, dst) in blocks.values_mut().zip(dst) {
if dst.is_none() {
// (ts, value) pair has been used - fetch next pair (if any).
dst[i] = block.next_pair();
*dst = block.next_pair();
}
}
}