Skip to content

Commit 586c57a

Browse files
authored
refactor(nns): Clarify voting code (#3210)
Small change to clarify voting function.
1 parent 5463a88 commit 586c57a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

rs/nns/governance/src/voting.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,16 @@ impl Governance {
202202
is_over_soft_limit: fn() -> bool,
203203
) {
204204
let proposal_id = machine.proposal_id;
205+
let Ok(ballots) = proposal_ballots(&mut self.heap_data.proposals, proposal_id.id) else {
206+
eprintln!(
207+
"{} Proposal {} for voting machine not found. Machine cannot complete work.",
208+
LOG_PREFIX, proposal_id.id
209+
);
210+
return;
211+
};
212+
205213
while !machine.is_completely_finished() {
206-
if let Ok(ballots) = proposal_ballots(&mut self.heap_data.proposals, proposal_id.id) {
207-
machine.continue_processing(&mut self.neuron_store, ballots, is_over_soft_limit);
208-
} else {
209-
eprintln!(
210-
"{} Proposal {} for voting machine not found. Machine cannot complete work.",
211-
LOG_PREFIX, proposal_id.id
212-
);
213-
break;
214-
}
214+
machine.continue_processing(&mut self.neuron_store, ballots, is_over_soft_limit);
215215

216216
if is_over_soft_limit() {
217217
break;

0 commit comments

Comments
 (0)