From f630cfb739a1c9bcd3b651b77963f41384cd4809 Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Thu, 28 Mar 2024 11:35:10 +0800 Subject: [PATCH] refactor(simapp): using maps.Clone to simplify codes (#19885) Co-authored-by: weixie.c --- simapp/app.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index 471c901f2d..3610f28c40 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "os" "path/filepath" @@ -764,12 +765,7 @@ func (app *SimApp) RegisterNodeService(clientCtx client.Context, cfg config.Conf // // 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.