Skip to content

Commit

Permalink
ccitt: use faster strconv.Itoa
Browse files Browse the repository at this point in the history
than fmt.Sprintf("%d"
  • Loading branch information
catenacyber committed Mar 20, 2023
1 parent b6ac75b commit cd62699
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ccitt/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"io/ioutil"
"log"
"os"
"strconv"
)

var debug = flag.Bool("debug", false, "")
Expand Down Expand Up @@ -115,7 +116,7 @@ func (n *node) String() string {
return "0"
}
if n.branchIndex > 0 {
return fmt.Sprintf("%d", n.branchIndex)
return strconv.Itoa(int(n.branchIndex))
}
return fmt.Sprintf("^%d", n.val)
}
Expand Down

0 comments on commit cd62699

Please sign in to comment.