]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm: use opd.String() instead of fmt.Sprintf
authorcuiweixie <cuiweixie@gmail.com>
Wed, 28 Sep 2022 13:23:06 +0000 (21:23 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 29 Sep 2022 09:04:56 +0000 (09:04 +0000)
Change-Id: Idbade74025bddb26ec3c10527de5af5dc2b8c1cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/435940
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

src/cmd/asm/internal/arch/arm64.go

index e426814aab76e7d19326063e6907f10a796e9f81..6790c6e7df05d9a9ae44770751d738be9b3adf41 100644 (file)
@@ -12,7 +12,6 @@ import (
        "cmd/internal/obj"
        "cmd/internal/obj/arm64"
        "errors"
-       "fmt"
 )
 
 var arm64LS = map[string]uint8{
@@ -66,8 +65,7 @@ func GetARM64SpecialOperand(name string) arm64.SpecialOperand {
                // Generate the mapping automatically when the first time the function is called.
                arm64SpecialOperand = map[string]arm64.SpecialOperand{}
                for opd := arm64.SPOP_BEGIN; opd < arm64.SPOP_END; opd++ {
-                       s := fmt.Sprintf("%s", opd)
-                       arm64SpecialOperand[s] = opd
+                       arm64SpecialOperand[opd.String()] = opd
                }
 
                // Handle some special cases.