Skip to content

Commit

Permalink
fix after review: better slice allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ssd04 committed Aug 2, 2022
1 parent 67ed8dd commit 5969f45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions consensus/signing/signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ func (sh *signatureHolder) AggregateSigs(bitmap []byte, epoch uint32) ([]byte, e
return nil, ErrBitmapMismatch
}

signatures := make([][]byte, 0, len(sh.data.sigShares))
pubKeysSigners := make([][]byte, 0, len(sh.data.sigShares))

multiSigner, err := sh.multiSignerContainer.GetMultiSigner(epoch)
if err != nil {
return nil, err
}

signatures := make([][]byte, 0, len(sh.data.sigShares))
pubKeysSigners := make([][]byte, 0, len(sh.data.sigShares))

for i := range sh.data.sigShares {
if !sh.isIndexInBitmap(uint16(i), bitmap) {
continue
Expand Down Expand Up @@ -280,7 +280,7 @@ func (sh *signatureHolder) Verify(message []byte, bitmap []byte, epoch uint32) e
return err
}

pubKeys := make([][]byte, 0)
pubKeys := make([][]byte, 0, len(sh.data.pubKeys))
for i, pk := range sh.data.pubKeys {
if !sh.isIndexInBitmap(uint16(i), bitmap) {
continue
Expand Down

0 comments on commit 5969f45

Please sign in to comment.