Commit e1f92e97 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cd42a2aa
......@@ -403,9 +403,9 @@ func (p *AcceptIdentification) NEOEncodedLen() int {
size += 30
for i := 0; i < len(p.KnownMasterList); i++ {
a := &p.KnownMasterList[i]
size += 10
size += 10 + len((*a).Address.Host)
}
return 0 + len(p.Primary.Host) + len((*a).Address.Host) + size
return 0 + len(p.Primary.Host) + size
}
func (p *AcceptIdentification) NEOEncode(data []byte) {
......@@ -724,9 +724,9 @@ func (p *AnswerPartitionTable) NEOEncodedLen() int {
size += 12
for i := 0; i < len(p.RowList); i++ {
a := &p.RowList[i]
size += 8
size += 8 + len((*a).CellList)*8
}
return 0 + len((*a).CellList)*8 + size
return 0 + size
}
func (p *AnswerPartitionTable) NEOEncode(data []byte) {
......@@ -813,9 +813,9 @@ func (p *NotifyPartitionTable) NEOEncodedLen() int {
size += 12
for i := 0; i < len(p.RowList); i++ {
a := &p.RowList[i]
size += 8
size += 8 + len((*a).CellList)*8
}
return 0 + len((*a).CellList)*8 + size
return 0 + size
}
func (p *NotifyPartitionTable) NEOEncode(data []byte) {
......@@ -2597,9 +2597,9 @@ func (p *AnswerPartitionList) NEOEncodedLen() int {
size += 12
for i := 0; i < len(p.RowList); i++ {
a := &p.RowList[i]
size += 8
size += 8 + len((*a).CellList)*8
}
return 0 + len((*a).CellList)*8 + size
return 0 + size
}
func (p *AnswerPartitionList) NEOEncode(data []byte) {
......@@ -2709,9 +2709,9 @@ func (p *AnswerNodeList) NEOEncodedLen() int {
size += 4
for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i]
size += 26
size += 26 + len((*a).Address.Host)
}
return 0 + len((*a).Address.Host) + size
return 0 + size
}
func (p *AnswerNodeList) NEOEncode(data []byte) {
......@@ -2920,9 +2920,9 @@ func (p *NotifyNodeInformation) NEOEncodedLen() int {
size += 4
for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i]
size += 26
size += 26 + len((*a).Address.Host)
}
return 0 + len((*a).Address.Host) + size
return 0 + size
}
func (p *NotifyNodeInformation) NEOEncode(data []byte) {
......
......@@ -388,8 +388,10 @@ func (s *sizer) genSlice(path string, typ *types.Slice, obj types.Object) {
s.emit("for i := 0; i < len(%v); i++ {", path)
s.emit("a := &%s[i]", path)
//codegenType("(*a)", typ.Elem(), obj, s)
codegenType("(*a)", typ.Elem(), obj, &sizer{})
s.emit("size += %v", s.n)
sloop := &sizer{}
codegenType("(*a)", typ.Elem(), obj, sloop)
// FIXME vvv if symLenv is ø; -> turn into "result" function
s.emit("size += %v + %v", sloop.n, strings.Join(sloop.symLenv, " + "))
s.emit("}")
s.n = 0
}
......
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