Skip to content

Commit

Permalink
Merge c2d1c7a into 9fffbd6
Browse files Browse the repository at this point in the history
  • Loading branch information
coderPonyGao committed Oct 22, 2019
2 parents 9fffbd6 + c2d1c7a commit cb92804
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/db/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl InternalKey {
#[inline]
pub fn user_key(&self) -> &[u8] {
let length = self.data.len();
&self.data.as_slice()[length - 8..]
&self.data.as_slice()[..length - 8]
}

/// Returns a `ParsedInternalKey`
Expand Down
1 change: 1 addition & 0 deletions src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,7 @@ pub(crate) fn build_table<'a>(
break;
}
prev_key = key;
iter.next();
}
if status.is_ok() {
meta.smallest = Rc::new(InternalKey::decoded_from(smallest_key.as_slice()));
Expand Down
3 changes: 2 additions & 1 deletion src/version/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ impl Version {
{
files_to_seek.push(f.clone());
}
files_to_seek.sort_by(|a, b| b.number.cmp(&a.number))

}
files_to_seek.sort_by(|a, b| b.number.cmp(&a.number));
} else {
let index = Self::find_file(self.icmp.clone(), self.files[level].as_slice(), &ikey);
if index >= files.len() {
Expand Down

0 comments on commit cb92804

Please sign in to comment.