Mercurial > lbo > hg > leveldb-rs
changeset 405:319a27b03734
merging_iter: Simplify condition in valid().
This gets us another few percent (1-3%) in iterator speed.
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Wed, 11 Oct 2017 21:21:57 +0200 |
parents | e58fe2511a3f |
children | c2d1c97102ca |
files | src/merging_iter.rs |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/merging_iter.rs Wed Oct 11 21:10:53 2017 +0200 +++ b/src/merging_iter.rs Wed Oct 11 21:21:57 2017 +0200 @@ -153,9 +153,7 @@ } fn valid(&self) -> bool { if let Some(ix) = self.current { - // TODO: second clause is unnecessary, because first asserts that at least one iterator - // is valid. - self.iters[ix].valid() && self.iters.iter().any(|it| it.valid()) + self.iters[ix].valid() } else { false }