dymension icon indicating copy to clipboard operation
dymension copied to clipboard

refactor slices functions, with new `slices` functionality

Open mtsitrin opened this issue 4 months ago • 0 comments

example:

this could all be shortened by a generic dedupe function, and https://pkg.go.dev/slices#ContainsFunc or https://pkg.go.dev/slices#IndexFunc

psuedo:

if len(permissioned) != len(deduped(permissioned)) {
..}
if i := slices.indexFunc(permissioned, func(x){
_, err := sdk.AccAddressFromBech32(x)
return err!=nil
}
}) {..}

something like that

Originally posted by @danwt in https://github.com/dymensionxyz/dymension/pull/712#discussion_r1535405565

mtsitrin avatar Mar 24 '24 13:03 mtsitrin