forked from TrueCloudLab/frostfs-contract
Merge pull request #1 from nspcc-dev/use-loop-labels
Use loop label in InnerRingUpdate call handler
This commit is contained in:
commit
35656b0661
1 changed files with 9 additions and 17 deletions
|
@ -230,35 +230,27 @@ func Main(op string, args []interface{}) interface{} {
|
||||||
offset = 10
|
offset = 10
|
||||||
newIR := []node{}
|
newIR := []node{}
|
||||||
|
|
||||||
for i := 0; i < listItemCount; i++ {
|
loop:
|
||||||
|
for i := 0; i < listItemCount; i, offset = i+1, offset+33 {
|
||||||
pub := data[offset : offset+33]
|
pub := data[offset : offset+33]
|
||||||
|
|
||||||
finished := false
|
|
||||||
|
|
||||||
for j := 0; j < len(irList); j++ {
|
for j := 0; j < len(irList); j++ {
|
||||||
n := irList[j]
|
n := irList[j]
|
||||||
if util.Equals(n.pub, pub) {
|
if util.Equals(n.pub, pub) {
|
||||||
newIR = append(newIR, n)
|
newIR = append(newIR, n)
|
||||||
finished = true
|
continue loop
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !finished {
|
for j := 0; j < len(candidates); j++ {
|
||||||
for j := 0; j < len(candidates); j++ {
|
n := candidates[j]
|
||||||
n := candidates[j]
|
if util.Equals(n.pub, pub) {
|
||||||
if util.Equals(n.pub, pub) {
|
newIR = append(newIR, n)
|
||||||
newIR = append(newIR, n)
|
continue loop
|
||||||
finished = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !finished {
|
|
||||||
panic("unknown inner ring candidate present in the list")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
offset += 33
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(newIR) != listItemCount {
|
if len(newIR) != listItemCount {
|
||||||
panic("new inner ring wasn't processed correctly")
|
panic("new inner ring wasn't processed correctly")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue