Skip to content

Commit cd535c1

Browse files
authored
refactor: using maps.Clone to simplify the code (#2090)
Signed-off-by: zhuhaicity <[email protected]>
1 parent 146cdea commit cd535c1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/app.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"io"
7+
"maps"
78
"os"
89
"path/filepath"
910
"sort"
@@ -1089,12 +1090,7 @@ func (app *WasmApp) RegisterNodeService(clientCtx client.Context, cfg config.Con
10891090
//
10901091
// NOTE: This is solely to be used for testing purposes.
10911092
func GetMaccPerms() map[string][]string {
1092-
dupMaccPerms := make(map[string][]string)
1093-
for k, v := range maccPerms {
1094-
dupMaccPerms[k] = v
1095-
}
1096-
1097-
return dupMaccPerms
1093+
return maps.Clone(maccPerms)
10981094
}
10991095

11001096
// BlockedAddresses returns all the app's blocked account addresses.

0 commit comments

Comments
 (0)