Msgsize returns the maximum size of the message.
()
| 261 | |
| 262 | // Msgsize returns the maximum size of the message. |
| 263 | func (s StringSorted) Msgsize() int { |
| 264 | if s == nil { |
| 265 | return msgp.NilSize |
| 266 | } |
| 267 | size := msgp.ArrayHeaderSize |
| 268 | for key := range s { |
| 269 | size += msgp.StringPrefixSize + len(key) |
| 270 | } |
| 271 | return size |
| 272 | } |
| 273 | |
| 274 | // StringSortedFromSlice creates a StringSorted from a slice. |
| 275 | func StringSortedFromSlice(s []string) StringSorted { |