[#59] util: Restore backwards compatibility in NestedStructureMarshal()

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-11-21 10:59:15 +03:00
parent 498877e378
commit 9cc2095446
2 changed files with 28 additions and 14 deletions

View file

@ -211,7 +211,7 @@ func (c *ObjectSessionContext) StableMarshal(buf []byte) []byte {
}
offset := proto.EnumMarshal(objectCtxVerbField, buf, int32(c.verb))
proto.NestedStructureMarshal(objectCtxTargetField, buf[offset:], objectSessionContextTarget{
proto.NestedStructureMarshalUnchecked(objectCtxTargetField, buf[offset:], objectSessionContextTarget{
cnr: c.cnr,
objs: c.objs,
})
@ -225,7 +225,7 @@ func (c *ObjectSessionContext) StableSize() (size int) {
}
size += proto.EnumSize(objectCtxVerbField, int32(c.verb))
size += proto.NestedStructureSize(objectCtxTargetField, objectSessionContextTarget{
size += proto.NestedStructureSizeUnchecked(objectCtxTargetField, objectSessionContextTarget{
cnr: c.cnr,
objs: c.objs,
})