MCPcopy Index your code
hub / github.com/HDT3213/rdb / writeNanString

Method writeNanString

core/string.go:299–307  ·  view source on GitHub ↗

write string without try int string. for tryWriteIntSetEncoding, writeZipList

(s string)

Source from the content-addressed store, hash-verified

297
298// write string without try int string. for tryWriteIntSetEncoding, writeZipList
299func (enc *Encoder) writeNanString(s string) error {
300 if enc.compress && len(s) > 20 {
301 err := enc.writeLZFString(s)
302 if err == nil { // lzf may failed, while out > in
303 return nil
304 }
305 }
306 return enc.writeSimpleString(s)
307}
308
309func (enc *Encoder) WriteStringObject(key string, value []byte, options ...interface{}) error {
310 err := enc.beforeWriteObject(options...)

Callers 2

writeZipListMethod · 0.95

Calls 2

writeLZFStringMethod · 0.95
writeSimpleStringMethod · 0.95

Tested by

no test coverage detected