Commit dbfa81a6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cd8d5919
...@@ -129,11 +129,7 @@ func (p *RowInfo) NEOEncodedLen() int { ...@@ -129,11 +129,7 @@ func (p *RowInfo) NEOEncodedLen() int {
{ {
l := uint32(len(p.CellList)) l := uint32(len(p.CellList))
size += 8 size += 8
for i := 0; uint32(i) < l; i++ { size += l * 8
a := &p.CellList[i]
_ = a
size += 8
}
} }
return int(size) + 0 return int(size) + 0
} }
...@@ -671,11 +667,7 @@ func (p *AnswerPartitionTable) NEOEncodedLen() int { ...@@ -671,11 +667,7 @@ func (p *AnswerPartitionTable) NEOEncodedLen() int {
{ {
l := uint32(len((*a).CellList)) l := uint32(len((*a).CellList))
size += 8 size += 8
for i := 0; uint32(i) < l; i++ { size += l * 8
a := &(*a).CellList[i]
_ = a
size += 8
}
} }
_ = a _ = a
size += 0 size += 0
...@@ -756,11 +748,7 @@ func (p *NotifyPartitionTable) NEOEncodedLen() int { ...@@ -756,11 +748,7 @@ func (p *NotifyPartitionTable) NEOEncodedLen() int {
{ {
l := uint32(len((*a).CellList)) l := uint32(len((*a).CellList))
size += 8 size += 8
for i := 0; uint32(i) < l; i++ { size += l * 8
a := &(*a).CellList[i]
_ = a
size += 8
}
} }
_ = a _ = a
size += 0 size += 0
...@@ -836,11 +824,7 @@ func (p *PartitionChanges) NEOEncodedLen() int { ...@@ -836,11 +824,7 @@ func (p *PartitionChanges) NEOEncodedLen() int {
{ {
l := uint32(len(p.CellList)) l := uint32(len(p.CellList))
size += 12 size += 12
for i := 0; uint32(i) < l; i++ { size += l * 12
a := &p.CellList[i]
_ = a
size += 12
}
} }
return int(size) + 0 return int(size) + 0
} }
...@@ -955,11 +939,7 @@ func (p *AnswerUnfinishedTransactions) NEOEncodedLen() int { ...@@ -955,11 +939,7 @@ func (p *AnswerUnfinishedTransactions) NEOEncodedLen() int {
{ {
l := uint32(len(p.TidList)) l := uint32(len(p.TidList))
size += 12 size += 12
for i := 0; uint32(i) < l; i++ { size += l * 8
a := &p.TidList[i]
_ = a
size += 8
}
} }
return int(size) + 0 return int(size) + 0
} }
...@@ -2190,11 +2170,7 @@ func (p *AnswerObjectHistory) NEOEncodedLen() int { ...@@ -2190,11 +2170,7 @@ func (p *AnswerObjectHistory) NEOEncodedLen() int {
{ {
l := uint32(len(p.HistoryList)) l := uint32(len(p.HistoryList))
size += 12 size += 12
for i := 0; uint32(i) < l; i++ { size += l * 12
a := &p.HistoryList[i]
_ = a
size += 12
}
} }
return int(size) + 0 return int(size) + 0
} }
...@@ -2277,11 +2253,7 @@ func (p *AnswerPartitionList) NEOEncodedLen() int { ...@@ -2277,11 +2253,7 @@ func (p *AnswerPartitionList) NEOEncodedLen() int {
{ {
l := uint32(len((*a).CellList)) l := uint32(len((*a).CellList))
size += 8 size += 8
for i := 0; uint32(i) < l; i++ { size += l * 8
a := &(*a).CellList[i]
_ = a
size += 8
}
} }
_ = a _ = a
size += 0 size += 0
......
...@@ -174,8 +174,20 @@ func typeSizeFixed(typ types.Type) (wireSize int, ok bool) { ...@@ -174,8 +174,20 @@ func typeSizeFixed(typ types.Type) (wireSize int, ok bool) {
if ok { if ok {
return basic.wireSize, ok return basic.wireSize, ok
} }
case *types.Struct:
for i := 0; i < u.NumFields(); i++ {
size, ok := typeSizeFixed(u.Field(i).Type())
if !ok {
goto notfixed
}
wireSize += size
}
return wireSize, true
} }
notfixed:
// not matched above - not fixed // not matched above - not fixed
return 0, false return 0, false
} }
......
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