Skip to content

Commit e50ae7c

Browse files
iquerejetajpraynaud
andcommitted
Apply suggestions from code review
Co-authored-by: Jean-Philippe Raynaud <[email protected]>
1 parent dcd1396 commit e50ae7c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mithril-stm/src/stm.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,13 +556,9 @@ impl<D: Digest + Clone + FixedOutput> StmClerk<D> {
556556
StmAggrVerificationKey::from(&self.closed_reg)
557557
}
558558

559-
/// Get the (VK, stake) of a party given it's index.
559+
/// Get the (VK, stake) of a party given its index.
560560
pub fn get_reg_party(&self, party_index: &Index) -> Option<(StmVerificationKey, Stake)> {
561-
if *party_index as usize >= self.closed_reg.reg_parties.len() {
562-
return None;
563-
}
564-
565-
Some(self.closed_reg.reg_parties[*party_index as usize].into())
561+
self.closed_reg.reg_parties.get(*party_index as usize).map(|r| r.into())
566562
}
567563
}
568564

0 commit comments

Comments
 (0)