MCPcopy Create free account
hub / github.com/vmihailenco/msgpack / decodeInternedStringWithLen

Method decodeInternedStringWithLen

intern.go:221–236  ·  view source on GitHub ↗
(n int, intern bool)

Source from the content-addressed store, hash-verified

219}
220
221func (d *Decoder) decodeInternedStringWithLen(n int, intern bool) (string, error) {
222 if n <= 0 {
223 return "", nil
224 }
225
226 s, err := d.stringWithLen(n)
227 if err != nil {
228 return "", err
229 }
230
231 if intern && len(s) >= minInternedStringLen && len(d.dict) < maxDictLen {
232 d.dict = append(d.dict, s)
233 }
234
235 return s, nil
236}

Callers 1

decodeInternedStringMethod · 0.95

Calls 1

stringWithLenMethod · 0.95

Tested by

no test coverage detected