Refactor: Remove Rc from PreAccount and InvokeContext::get_account() (#21882)

* Removes Rc and RefCell from PreAccount

* Splits get_account() into find_index_of_account() and get_account_at_index()
in order to remove Rc from return type.
This commit is contained in:
Alexander Meißner
2021-12-14 15:44:31 +01:00
committed by GitHub
parent c92c09a8be
commit 4adc8b133f
5 changed files with 74 additions and 68 deletions

View File

@ -17,7 +17,7 @@ fn bench_verify_account_changes_data(bencher: &mut Bencher) {
let non_owner = pubkey::new_rand();
let pre = PreAccount::new(
&pubkey::new_rand(),
&AccountSharedData::new(0, BUFSIZE, &owner),
AccountSharedData::new(0, BUFSIZE, &owner),
);
let post = AccountSharedData::new(0, BUFSIZE, &owner);
assert_eq!(
@ -57,7 +57,7 @@ fn bench_verify_account_changes_data(bencher: &mut Bencher) {
let pre = PreAccount::new(
&pubkey::new_rand(),
&AccountSharedData::new(0, BUFSIZE, &owner),
AccountSharedData::new(0, BUFSIZE, &owner),
);
bencher.iter(|| {
pre.verify(