From 9a7af62267a0d78e4655d288838cef00b8b670f1 Mon Sep 17 00:00:00 2001 From: yetyear Date: Fri, 9 May 2025 12:14:29 +0800 Subject: [PATCH] refactor: replace []byte(fmt.Sprintf) with fmt.Appendf Signed-off-by: yetyear --- x/amm/types/keys.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/amm/types/keys.go b/x/amm/types/keys.go index 765c4dfa0..223411fc2 100644 --- a/x/amm/types/keys.go +++ b/x/amm/types/keys.go @@ -76,7 +76,7 @@ func DenomLiquidityKey(denom string) []byte { } func TKeyPrefixSwapExactAmountInPrefix(m *MsgSwapExactAmountIn) []byte { - prefix := []byte(fmt.Sprintf("%s/", m.TokenIn.Denom)) + prefix := fmt.Appendf(nil, "%s/", m.TokenIn.Denom) routeKeys := []string{} for _, route := range m.Routes[:1] { routeKeys = append(routeKeys, fmt.Sprintf("%d/%s", route.PoolId, route.TokenOutDenom)) @@ -101,7 +101,7 @@ func TKeyPrefixSwapExactAmountIn(m *MsgSwapExactAmountIn, index uint64) []byte { } func TKeyPrefixSwapExactAmountOutPrefix(m *MsgSwapExactAmountOut) []byte { - prefix := []byte(fmt.Sprintf("/%s", m.TokenOut.Denom)) + prefix := fmt.Appendf(nil, "/%s", m.TokenOut.Denom) routeKeys := []string{} if len(m.Routes) > 0 { route := m.Routes[len(m.Routes)-1]