@@ -112,19 +112,10 @@ func (z Keys) MarshalMsg(b []byte) (o []byte, err error) {
112
112
if z [xvk ] == nil {
113
113
o = msgp .AppendNil (o )
114
114
} else {
115
- // map header, size 3
116
- // string "u"
117
- o = append (o , 0x83 , 0xa1 , 0x75 )
118
- o = msgp .AppendBytes (o , []byte (z [xvk ].UUID ))
119
- // string "v"
120
- o = append (o , 0xa1 , 0x76 )
121
- o , err = msgp .AppendIntf (o , z [xvk ].Value )
115
+ o , err = z [xvk ].MarshalMsg (o )
122
116
if err != nil {
123
117
return
124
118
}
125
- // string "p"
126
- o = append (o , 0xa1 , 0x70 )
127
- o = msgp .AppendBytes (o , z [xvk ].Payload )
128
119
}
129
120
}
130
121
return
@@ -153,46 +144,10 @@ func (z *Keys) UnmarshalMsg(bts []byte) (o []byte, err error) {
153
144
if (* z )[bzg ] == nil {
154
145
(* z )[bzg ] = new (Key )
155
146
}
156
- var field []byte
157
- _ = field
158
- var isz uint32
159
- isz , bts , err = msgp .ReadMapHeaderBytes (bts )
147
+ bts , err = (* z )[bzg ].UnmarshalMsg (bts )
160
148
if err != nil {
161
149
return
162
150
}
163
- for isz > 0 {
164
- isz --
165
- field , bts , err = msgp .ReadMapKeyZC (bts )
166
- if err != nil {
167
- return
168
- }
169
- switch msgp .UnsafeString (field ) {
170
- case "u" :
171
- {
172
- var tmp []byte
173
- tmp , bts , err = msgp .ReadBytesBytes (bts , []byte ((* z )[bzg ].UUID ))
174
- (* z )[bzg ].UUID = ID (tmp )
175
- }
176
- if err != nil {
177
- return
178
- }
179
- case "v" :
180
- (* z )[bzg ].Value , bts , err = msgp .ReadIntfBytes (bts )
181
- if err != nil {
182
- return
183
- }
184
- case "p" :
185
- (* z )[bzg ].Payload , bts , err = msgp .ReadBytesBytes (bts , (* z )[bzg ].Payload )
186
- if err != nil {
187
- return
188
- }
189
- default :
190
- bts , err = msgp .Skip (bts )
191
- if err != nil {
192
- return
193
- }
194
- }
195
- }
196
151
}
197
152
}
198
153
o = bts
@@ -205,7 +160,7 @@ func (z Keys) Msgsize() (s int) {
205
160
if z [bai ] == nil {
206
161
s += msgp .NilSize
207
162
} else {
208
- s += 1 + 2 + msgp . BytesPrefixSize + len ([] byte ( z [bai ].UUID )) + 2 + msgp . GuessSize ( z [ bai ]. Value ) + 2 + msgp . BytesPrefixSize + len ( z [ bai ]. Payload )
163
+ s += z [bai ].Msgsize ( )
209
164
}
210
165
}
211
166
return
@@ -237,19 +192,10 @@ func (z *Node) MarshalMsg(b []byte) (o []byte, err error) {
237
192
if z .ChildKeys [ajw ] == nil {
238
193
o = msgp .AppendNil (o )
239
194
} else {
240
- // map header, size 3
241
- // string "u"
242
- o = append (o , 0x83 , 0xa1 , 0x75 )
243
- o = msgp .AppendBytes (o , []byte (z .ChildKeys [ajw ].UUID ))
244
- // string "v"
245
- o = append (o , 0xa1 , 0x76 )
246
- o , err = msgp .AppendIntf (o , z .ChildKeys [ajw ].Value )
195
+ o , err = z .ChildKeys [ajw ].MarshalMsg (o )
247
196
if err != nil {
248
197
return
249
198
}
250
- // string "p"
251
- o = append (o , 0xa1 , 0x70 )
252
- o = msgp .AppendBytes (o , z .ChildKeys [ajw ].Payload )
253
199
}
254
200
}
255
201
return
@@ -324,44 +270,10 @@ func (z *Node) UnmarshalMsg(bts []byte) (o []byte, err error) {
324
270
if z .ChildKeys [ajw ] == nil {
325
271
z .ChildKeys [ajw ] = new (Key )
326
272
}
327
- var isz uint32
328
- isz , bts , err = msgp .ReadMapHeaderBytes (bts )
273
+ bts , err = z .ChildKeys [ajw ].UnmarshalMsg (bts )
329
274
if err != nil {
330
275
return
331
276
}
332
- for isz > 0 {
333
- isz --
334
- field , bts , err = msgp .ReadMapKeyZC (bts )
335
- if err != nil {
336
- return
337
- }
338
- switch msgp .UnsafeString (field ) {
339
- case "u" :
340
- {
341
- var tmp []byte
342
- tmp , bts , err = msgp .ReadBytesBytes (bts , []byte (z .ChildKeys [ajw ].UUID ))
343
- z .ChildKeys [ajw ].UUID = ID (tmp )
344
- }
345
- if err != nil {
346
- return
347
- }
348
- case "v" :
349
- z .ChildKeys [ajw ].Value , bts , err = msgp .ReadIntfBytes (bts )
350
- if err != nil {
351
- return
352
- }
353
- case "p" :
354
- z .ChildKeys [ajw ].Payload , bts , err = msgp .ReadBytesBytes (bts , z .ChildKeys [ajw ].Payload )
355
- if err != nil {
356
- return
357
- }
358
- default :
359
- bts , err = msgp .Skip (bts )
360
- if err != nil {
361
- return
362
- }
363
- }
364
- }
365
277
}
366
278
}
367
279
default :
@@ -385,7 +297,7 @@ func (z *Node) Msgsize() (s int) {
385
297
if z .ChildKeys [ajw ] == nil {
386
298
s += msgp .NilSize
387
299
} else {
388
- s += 1 + 2 + msgp . BytesPrefixSize + len ([] byte ( z .ChildKeys [ajw ].UUID )) + 2 + msgp . GuessSize ( z . ChildKeys [ ajw ]. Value ) + 2 + msgp . BytesPrefixSize + len ( z . ChildKeys [ ajw ]. Payload )
300
+ s += z .ChildKeys [ajw ].Msgsize ( )
389
301
}
390
302
}
391
303
return
0 commit comments