Skip to content

Commit 5e2cd1d

Browse files
cuishuangCoderZhienvestcc
authored
fix: fix slice init length (#4412)
Co-authored-by: CoderZhi <thecoderzhi@gmail.com> Co-authored-by: Chen Chen <chen1233216@hotmail.com>
1 parent 112815d commit 5e2cd1d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ioctl/cmd/ws/wsdeviceapprove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func approveProjectDevice(projectID uint64, devices string) (string, error) {
6161
deviceArr = strings.Split(devices, ",")
6262
}
6363

64-
deviceAddress := make([]common.Address, len(deviceArr))
64+
deviceAddress := make([]common.Address, 0, len(deviceArr))
6565
for _, device := range deviceArr {
6666
addr, err := address.FromString(device)
6767
if err != nil {

ioctl/cmd/ws/wsdeviceunapprove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func unapproveProjectDevice(projectID uint64, devices string) (string, error) {
6161
deviceArr = strings.Split(devices, ",")
6262
}
6363

64-
deviceAddress := make([]common.Address, len(deviceArr))
64+
deviceAddress := make([]common.Address, 0, len(deviceArr))
6565
for _, device := range deviceArr {
6666
addr, err := address.FromString(device)
6767
if err != nil {

0 commit comments

Comments
 (0)