Mercurial > lbo > hg > leveldb-rs
changeset 95:16048b8b2d9c
Explain why we need a workaround for the block iterator
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Mon, 19 Sep 2016 17:51:40 +0000 |
parents | b09acb0e365e |
children | f4050d58ad85 |
files | src/block.rs |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/block.rs Thu Sep 15 12:48:32 2016 +0200 +++ b/src/block.rs Mon Sep 19 17:51:40 2016 +0000 @@ -97,6 +97,8 @@ /// and that Block inside the same struct, we just store the state here. By using /// Block::restore_iter(), an iterator can be reconstructed later and used inside the scope of one /// function. +/// This is important for efficient iteration over blocks as it saves us from copying the values +/// over and over to new Vecs. Even an `Rc<>` couldn't avoid that :( pub struct BlockIterState { // start of next entry offset: usize,