File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -102,14 +102,14 @@ impl<U: UnitWithParents> CandidateElection<U> {
102
102
return Ok ( ( ) ) ;
103
103
}
104
104
let relative_round = voter. round ( ) - self . round ;
105
- let direct_parents = voter. direct_parents ( ) . cloned ( ) . collect ( ) ;
106
105
let vote = match relative_round {
107
106
0 => unreachable ! ( "just checked that voter and election rounds are not equal" ) ,
108
107
// Direct descendands vote for, all other units of that round against.
109
108
1 => voter. parent_for ( self . candidate_creator ) == Some ( & self . candidate_hash ) ,
110
109
// Otherwise we compute the vote based on the parents' votes.
111
110
_ => {
112
111
let threshold = voter. node_count ( ) . consensus_threshold ( ) ;
112
+ let direct_parents = voter. direct_parents ( ) . cloned ( ) . collect ( ) ;
113
113
self . vote_from_parents ( direct_parents, threshold, relative_round) ?
114
114
}
115
115
} ;
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ impl DagFeeder {
139
139
140
140
fn on_reconstructed_unit ( & mut self , unit : ReconstructedUnit ) {
141
141
let h = unit. hash ( ) ;
142
- let parents = unit. parents ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
142
+ let parents: HashSet < _ > = unit. parents ( ) . cloned ( ) . collect ( ) ;
143
143
let expected_hashes: HashSet < _ > = self
144
144
. units_map
145
145
. get ( & h)
@@ -148,7 +148,7 @@ impl DagFeeder {
148
148
. into_iter ( )
149
149
. collect ( ) ;
150
150
151
- assert_eq ! ( parents. into_iter ( ) . collect :: < HashSet <_>> ( ) , expected_hashes) ;
151
+ assert_eq ! ( parents, expected_hashes) ;
152
152
self . result . push ( unit. clone ( ) ) ;
153
153
self . store . insert ( unit) ;
154
154
}
You can’t perform that action at this time.
0 commit comments