1
0
mirror of https://github.com/golang/go synced 2024-11-23 15:20:03 -07:00

cmd/compiler/internal/gc: remove flag from bconv (cleanup)

Change-Id: I863eb8ef491e1d51b83d8dd3061bf11cbdc74a3e
Reviewed-on: https://go-review.googlesource.com/136196
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2018-09-18 21:15:19 -07:00
parent 919d5aee22
commit 3f99d2738d
2 changed files with 5 additions and 8 deletions

View File

@ -514,10 +514,10 @@ func (v Val) vconv(s fmt.State, flag FmtFlag) {
case *Mpint:
if !u.Rune {
if flag&FmtSharp != 0 {
fmt.Fprint(s, bconv(u, FmtSharp))
fmt.Fprint(s, bconv(u))
return
}
fmt.Fprint(s, bconv(u, 0))
fmt.Fprint(s, u.String())
return
}

View File

@ -300,12 +300,9 @@ func (a *Mpint) SetString(as string) {
}
func (a *Mpint) String() string {
return bconv(a, 0)
return a.Val.String()
}
func bconv(xval *Mpint, flag FmtFlag) string {
if flag&FmtSharp != 0 {
return fmt.Sprintf("%#x", &xval.Val)
}
return xval.Val.String()
func bconv(a *Mpint) string {
return fmt.Sprintf("%#x", &a.Val)
}