Mercurial > lbo > hg > leveldb-rs
changeset 154:c4b97788d886
Rename method parameter in TableReader::get()
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 26 Feb 2017 09:15:05 +0100 |
parents | c4b748594ad6 |
children | 6e84fedbe441 |
files | src/table_reader.rs |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/table_reader.rs Sat Feb 18 09:48:09 2017 +0100 +++ b/src/table_reader.rs Sun Feb 26 09:15:05 2017 +0100 @@ -203,13 +203,13 @@ /// Retrieve value from table. This function uses the attached filters, so is better suited if /// you frequently look for non-existing values (as it will detect the non-existence of an /// entry in a block without having to load the block). - pub fn get<'a>(&mut self, to: InternalKey<'a>) -> Option<Vec<u8>> { + pub fn get<'a>(&mut self, key: InternalKey<'a>) -> Option<Vec<u8>> { let mut index_iter = self.indexblock.iter(); - index_iter.seek(to); + index_iter.seek(key); let handle; if let Some((last_in_block, h)) = index_iter.current() { - if self.opt.cmp.cmp(to, &last_in_block) == Ordering::Less { + if self.opt.cmp.cmp(key, &last_in_block) == Ordering::Less { handle = BlockHandle::decode(&h).0; } else { return None; @@ -222,7 +222,7 @@ // Check bloom (or whatever) filter if let Some(ref filters) = self.filters { - if !filters.key_may_match(handle.offset(), to) { + if !filters.key_may_match(handle.offset(), key) { return None; } } @@ -236,9 +236,9 @@ } // Go to entry and check if it's the wanted entry. - iter.seek(to); + iter.seek(key); if let Some((k, v)) = iter.current() { - if self.opt.cmp.cmp(to, &k) == Ordering::Equal { + if self.opt.cmp.cmp(key, &k) == Ordering::Equal { Some(v) } else { None