From 08234b6623376499a4a22bbee8f5fa8d86f9ab4a Mon Sep 17 00:00:00 2001 From: zhuhaicity Date: Sun, 12 Jan 2025 16:24:33 +0800 Subject: [PATCH] refactor: using maps.Clone to simplify the code Signed-off-by: zhuhaicity --- app/app.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/app.go b/app/app.go index 984c5003d2..7a3693354c 100644 --- a/app/app.go +++ b/app/app.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "os" "path/filepath" "sort" @@ -1156,12 +1157,7 @@ func (app *WasmApp) RegisterNodeService(clientCtx client.Context, cfg config.Con // // NOTE: This is solely to be used for testing purposes. func GetMaccPerms() map[string][]string { - dupMaccPerms := make(map[string][]string) - for k, v := range maccPerms { - dupMaccPerms[k] = v - } - - return dupMaccPerms + return maps.Clone(maccPerms) } // BlockedAddresses returns all the app's blocked account addresses.