generate: Convert int64 to int to satisfy range
This is a stupid fucking restriction
This commit is contained in:
parent
170f79c914
commit
c18e251b4a
@ -662,7 +662,7 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
||||
n += nn; if err != nil { return n, err }
|
||||
nn, err = this.printf(", %s)\n", lengthVar)
|
||||
n += nn; if err != nil { return n, err }
|
||||
nn, err = this.iprintf("for index := range %s {\n", lengthVar)
|
||||
nn, err = this.iprintf("for index := range int(%s) {\n", lengthVar)
|
||||
n += nn; if err != nil { return n, err }
|
||||
this.push()
|
||||
nn, err = this.generateDecodeValue(typ.Element, "(*this)[index]", elementTagVar)
|
||||
@ -691,7 +691,7 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
||||
// problems
|
||||
|
||||
// read fields
|
||||
nn, err = this.iprintf("for %s = range %s {\n", indexVar, lengthVar)
|
||||
nn, err = this.iprintf("for %s = range int(%s) {\n", indexVar, lengthVar)
|
||||
n += nn; if err != nil { return n, err }
|
||||
this.push()
|
||||
// read field header
|
||||
|
Loading…
x
Reference in New Issue
Block a user