Skip to content

Commit

Permalink
use range over integers where possible
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
  • Loading branch information
carpawell committed Aug 20, 2024
1 parent 07bca47 commit ce6f86d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (x *Container) SetAttribute(key, value string) {
attrs := x.v2.GetAttributes()
ln := len(attrs)

for i := 0; i < ln; i++ {
for i := range ln {
if attrs[i].GetKey() == key {
attrs[i].SetValue(value)
return
Expand Down
6 changes: 3 additions & 3 deletions eacl/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func SetTargetECDSAKeys(t *Target, pubs ...*ecdsa.PublicKey) {
binKeys = make([][]byte, 0, ln)
}

for i := 0; i < ln; i++ {
for i := range ln {
binKeys = append(binKeys, (*keys.PublicKey)(pubs[i]).Bytes())
}

Expand All @@ -163,7 +163,7 @@ func SetTargetAccounts(t *Target, accs ...util.Uint160) {
account := make([]user.ID, len(accs))
ln := len(accs)

for i := 0; i < ln; i++ {
for i := range ln {
account[i] = user.NewFromScriptHash(accs[i])
}

Expand All @@ -180,7 +180,7 @@ func TargetECDSAKeys(t *Target) []*ecdsa.PublicKey {

pubs := make([]*ecdsa.PublicKey, ln)

for i := 0; i < ln; i++ {
for i := range ln {
p := new(keys.PublicKey)
if p.DecodeBytes(binKeys[i]) == nil {
pubs[i] = (*ecdsa.PublicKey)(p)
Expand Down
2 changes: 1 addition & 1 deletion stat/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *PoolStat) OperationCallback(nodeKey []byte, endpoint string, method Met
mon, ok := s.monitors[k]
if !ok {
methods := make([]*methodStatus, MethodLast)
for i := MethodBalanceGet; i < MethodLast; i++ {
for i := range MethodLast {
methods[i] = &methodStatus{name: i.String()}
}

Expand Down

0 comments on commit ce6f86d

Please sign in to comment.