Commit 1bb595cf authored by Kirill Smelkov's avatar Kirill Smelkov

go/neo/proto: protogen: Fix naming thinko in decoderN.genBuf

For decode-family of functions protogen.go sticks to convention to name
target variable to where to assign the result as "assignto", not "path".

No change in generated code.
parent c0d54d50
......@@ -961,7 +961,7 @@ func (e *encoderN) genBuf(path string) {
e.genSlice1(path+".XData()", nil /* typ unused */)
}
func (d *decoderN) genBuf(path string) {
func (d *decoderN) genBuf(assignto string) {
d.emit("{")
d.genBasic("l:", types.Typ[types.Uint32], nil)
......@@ -971,8 +971,8 @@ func (d *decoderN) genBuf(path string) {
d.overflow.AddExpr("uint64(l)")
// TODO eventually do not copy but reference original
d.emit("%v= mem.BufAlloc(int(l))", path)
d.emit("copy(%v.Data, data[:l])", path)
d.emit("%v= mem.BufAlloc(int(l))", assignto)
d.emit("copy(%v.Data, data[:l])", assignto)
d.emit("data = data[l:]")
d.emit("}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment