Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Refactory of Fork-Tree data structure #11228

Merged
merged 22 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dca037d
Iterative version of some fork-tree methods
davxy Apr 5, 2022
1e746fc
Prune doesn't require its generic args to be 'clone'
davxy Apr 6, 2022
23cc533
Fork-tree import and drain-filter iterative implementations
davxy Apr 14, 2022
47d1759
Fork-tree map iterative implementation
davxy Apr 15, 2022
6477e73
Merge branch 'master' into davxy-iterative-fork-tree-methods
davxy Apr 15, 2022
acdbbb5
Optimization of some operations, e.g. rebalance only when required
davxy Apr 15, 2022
a090eb1
Destructuring assignments not supported by stable rustc 1.57
davxy Apr 15, 2022
051ac86
Nitpicks
davxy Apr 15, 2022
9163787
Safe implementation of 'map' and 'drain_filter' methods
davxy Apr 22, 2022
406b526
Remove dummy comment
davxy Apr 22, 2022
b79c4cf
Merge branch 'master' into davxy-iterative-fork-tree-methods
davxy Apr 22, 2022
9f8fd20
Trigger CI pipeline
davxy Apr 23, 2022
1dde93b
Test map for multi-root fork-tree and refactory of `find_node_index_w…
davxy Apr 26, 2022
7d8c7a3
Fix find node index with predicate
davxy Apr 28, 2022
29215b5
Nits
davxy Apr 28, 2022
e0e2d70
Merge branch 'master' into davxy-iterative-fork-tree-methods
davxy Apr 28, 2022
182d073
Tree traversal algorithm is not specified
davxy Apr 29, 2022
9cc8b51
Move unspecified tree traversal warning to 'map'
davxy Apr 29, 2022
f6d04e1
Immutable 'drain_filter' predicate
davxy Apr 29, 2022
863105f
Apply suggestions from code review
davxy May 10, 2022
bc5d9fb
Apply suggestions from code review
davxy May 10, 2022
f0269d4
Remove double mapping
davxy May 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/finality-grandpa/src/authorities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ where
where
F: Fn(&H, &H) -> Result<bool, E>,
{
let mut filter = |node_hash: &H, node_num: &N, _: &PendingChange<H, N>| {
let filter = |node_hash: &H, node_num: &N, _: &PendingChange<H, N>| {
if number >= *node_num &&
(is_descendent_of(node_hash, &hash).unwrap_or_default() || *node_hash == hash)
{
Expand All @@ -245,7 +245,7 @@ where
};

// Remove standard changes.
let _ = self.pending_standard_changes.drain_filter(&mut filter);
let _ = self.pending_standard_changes.drain_filter(&filter);

// Remove forced changes.
self.pending_forced_changes
Expand Down
Loading