Skip to content

Commit

Permalink
Simplify if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
K1li4nL committed May 31, 2024
1 parent 5f9de9f commit 0ccad55
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions share/dkg/pedersen/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,10 @@ func (d *DistKeyGenerator) ProcessResponses(bundles []*ResponseBundle) (res *Res
if d.canReceive {
res, err := d.computeResult()
return res, nil, err
} else {
// old nodes that are not present in the new group
return nil, nil, nil
}

// old nodes that are not present in the new group
return nil, nil, nil
}

// check if there are some node who received at least t complaints.
Expand Down Expand Up @@ -853,9 +853,9 @@ func (d *DistKeyGenerator) computeResult() (*Result, error) {
if d.isResharing {
// instead of adding, in this case, we interpolate all shares
return d.computeResharingResult()
} else {
return d.computeDKGResult()
}

return d.computeDKGResult()
}

func (d *DistKeyGenerator) computeResharingResult() (*Result, error) {
Expand Down Expand Up @@ -1159,10 +1159,10 @@ func (c *Config) CheckForDuplicates() error {
for _, n := range list {
if _, present := hashSet[n.Index]; present {
return fmt.Errorf("index %d", n.Index)
} else {
hashSet[n.Index] = true
}
hashSet[n.Index] = true
}

return nil
}
if err := checkDuplicate(c.OldNodes); err != nil {
Expand Down

0 comments on commit 0ccad55

Please sign in to comment.