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

Remove redundant code from Bank::wrap_with_bank_forks_for_tests() #34448

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

steviez
Copy link
Contributor

@steviez steviez commented Dec 13, 2023

Problem

The same initialization occurs when the Bank is inserted into a new BankForks, so no need to duplicate the logic in this test function

Summary of Changes

Remove redundant code; below is the snippet where this same thing happens in BankForks::new_from_banks():

for bank in bank_forks.read().unwrap().banks.values() {
bank.loaded_programs_cache
.write()
.unwrap()
.set_fork_graph(bank_forks.clone());
}

The same initialization occurs when the Bank is inserted into a new
BankForks, so no need to duplicate the logic in this test function
@steviez steviez marked this pull request as ready for review December 13, 2023 22:21
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Merging #34448 (6612481) into master (2dfcdce) will increase coverage by 0.0%.
Report is 3 commits behind head on master.
The diff coverage is 100.0%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #34448   +/-   ##
=======================================
  Coverage    81.8%    81.8%           
=======================================
  Files         819      819           
  Lines      220923   220921    -2     
=======================================
+ Hits       180870   180905   +35     
+ Misses      40053    40016   -37     

@steviez steviez merged commit fe7970c into solana-labs:master Dec 14, 2023
34 checks passed
@steviez steviez deleted the bank_wrap_with_bfs branch December 14, 2023 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants