Remove redundant check (#7369)

This commit is contained in:
carllin 2019-12-09 01:12:14 -08:00 committed by GitHub
parent e0600e5a91
commit bee3829960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 10 deletions

View File

@ -893,19 +893,10 @@ impl Blocktree {
// Parent for slot meta should have been set by this point
assert!(!is_orphan(slot_meta));
let data_cf = self.db.column::<cf::ShredData>();
let check_data_cf = |slot, index| {
data_cf
.get_bytes((slot, index))
.map(|opt| opt.is_some())
.unwrap_or(false)
};
let new_consumed = if slot_meta.consumed == index {
let mut current_index = index + 1;
while data_index.is_present(current_index) || check_data_cf(slot, current_index) {
while data_index.is_present(current_index) {
current_index += 1;
}
current_index