ancestors::new -> default (#17195)

This commit is contained in:
Jeff Washington (jwash) 2021-05-14 15:20:59 -05:00 committed by GitHub
parent 3f0480d060
commit fd88db7339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -238,7 +238,7 @@ fn bench_concurrent_read_write(bencher: &mut Bencher) {
let i = rng.gen_range(0, pubkeys.len());
test::black_box(
accounts
.load_without_fixed_root(&Ancestors::new(), &pubkeys[i])
.load_without_fixed_root(&Ancestors::default(), &pubkeys[i])
.unwrap(),
);
}

View File

@ -7507,7 +7507,7 @@ pub mod tests {
db.store_uncached(slot, &[(&pubkey, &account)]);
let (account, slot) = db
.load_without_fixed_root(&Ancestors::new(), &pubkey)
.load_without_fixed_root(&Ancestors::default(), &pubkey)
.unwrap_or_else(|| {
panic!("Could not fetch stored account {}, iter {}", pubkey, i)
});
@ -8937,7 +8937,7 @@ pub mod tests {
// Should still be able to find zero lamport account in slot 1
assert_eq!(
db.load_without_fixed_root(&Ancestors::new(), &account_key),
db.load_without_fixed_root(&Ancestors::default(), &account_key),
Some((zero_lamport_account, 1))
);
}
@ -8953,7 +8953,7 @@ pub mod tests {
// Load with no ancestors and no root will return nothing
assert!(db
.load_without_fixed_root(&Ancestors::new(), &key)
.load_without_fixed_root(&Ancestors::default(), &key)
.is_none());
// Load with ancestors not equal to `slot` will return nothing
@ -8970,7 +8970,7 @@ pub mod tests {
// Adding root will return the account even without ancestors
db.add_root(slot);
assert_eq!(
db.load_without_fixed_root(&Ancestors::new(), &key),
db.load_without_fixed_root(&Ancestors::default(), &key),
Some((account0, slot))
);
}
@ -8998,7 +8998,7 @@ pub mod tests {
db.add_root(slot);
db.flush_accounts_cache(true, None);
assert_eq!(
db.load_without_fixed_root(&Ancestors::new(), &key),
db.load_without_fixed_root(&Ancestors::default(), &key),
Some((account0, slot))
);
}
@ -9043,11 +9043,11 @@ pub mod tests {
assert_eq!(db.accounts_cache.num_slots(), 1);
assert!(db.accounts_cache.slot_cache(unrooted_slot).is_some());
assert_eq!(
db.load_without_fixed_root(&Ancestors::new(), &key5),
db.load_without_fixed_root(&Ancestors::default(), &key5),
Some((account0.clone(), root5))
);
assert_eq!(
db.load_without_fixed_root(&Ancestors::new(), &key6),
db.load_without_fixed_root(&Ancestors::default(), &key6),
Some((account0, root6))
);
}