ancestors::new -> default (#17195)
This commit is contained in:
parent
3f0480d060
commit
fd88db7339
|
@ -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(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue