Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes some trivial casts #147

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions admin/src/bench/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ pub fn run_internal(args: Args, db: Db) {
0
};

COMMITS.store(start_commit as usize, Ordering::SeqCst);
NEXT_COMMIT.store(start_commit as usize, Ordering::SeqCst);
COMMITS.store(start_commit, Ordering::SeqCst);
NEXT_COMMIT.store(start_commit, Ordering::SeqCst);

{
let commits = args.commits;
Expand Down
11 changes: 4 additions & 7 deletions src/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,10 @@ impl Column {
let target_tier = tables
.iter()
.position(|t| t.value_size(key).map_or(false, |s| len <= s as usize));
let target_tier = match target_tier {
Some(tier) => tier as usize,
None => {
log::trace!(target: "parity-db", "Using blob {}", key);
tables.len() - 1
},
};
let target_tier = target_tier.unwrap_or_else(|| {
log::trace!(target: "parity-db", "Using blob {}", key);
tables.len() - 1
});

(result, target_tier)
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ mod test {
let mut hasher = DefaultHasher::new();
i.hash(&mut hasher);
let hash = hasher.finish();
let entry = Entry::from_u64(hash as u64);
let entry = Entry::from_u64(hash);
IndexTable::write_entry(&entry, i, &mut chunk2);
*chunk = entry;
}
Expand Down