Skip to content

Commit

Permalink
- simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
pjebs committed Mar 27, 2020
1 parent 0f31e5a commit 04ebaf1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/strconv/atoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ func convErr(err error, s string) error {

func parseComplexComponent(s, orig string, bitSize int) (float64, error) {
if bitSize == 64 {
f, err := ParseFloat(s, 32)
if err != nil {
return 0, convErr(err, orig)
}
return f, nil
bitSize = 32
} else {
bitSize = 64
}

f, err := ParseFloat(s, 64)
f, err := ParseFloat(s, bitSize)
if err != nil {
return 0, convErr(err, orig)
}
Expand Down

0 comments on commit 04ebaf1

Please # to comment.