-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(state-sync): don't make the caller of StateSync::run() expli… (
#9655) …citly save state The caller of StateSync::run() is expected to save the HashMap passed to this function if StateSync::run() returns StateSyncResult::Changed. This means that StateSync::run() needs to keep track of whether it changed anything in this hashmap throughout all the functions it calls, and then have the caller replace its stored hash map with the cloned one passed to this function. This is like implementing a function fn f(x: &mut u32) {} with fn(x: &mut u32) -> bool {} where the caller is expected to clone the argument and save it if the function returns true, which kind of complicates the functions involved and makes refactoring other things a little messier. It is also kind of error prone: #6939
- Loading branch information
1 parent
4e947b1
commit 49c11a5
Showing
3 changed files
with
76 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.