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

Method writeSetEncoding

core/set.go:108–128  ·  view source on GitHub ↗
(key string, values [][]byte)

Source from the content-addressed store, hash-verified

106}
107
108func (enc *Encoder) writeSetEncoding(key string, values [][]byte) error {
109 err := enc.write([]byte{typeSet})
110 if err != nil {
111 return err
112 }
113 err = enc.writeString(key)
114 if err != nil {
115 return err
116 }
117 err = enc.writeLength(uint64(len(values)))
118 if err != nil {
119 return err
120 }
121 for _, value := range values {
122 err = enc.writeString(unsafeBytes2Str(value))
123 if err != nil {
124 return err
125 }
126 }
127 return nil
128}
129
130func (enc *Encoder) tryWriteIntSetEncoding(key string, values [][]byte) (bool, error) {
131 max := int64(math.MinInt64)

Callers 1

WriteSetObjectMethod · 0.95

Calls 4

writeMethod · 0.95
writeStringMethod · 0.95
writeLengthMethod · 0.95
unsafeBytes2StrFunction · 0.70

Tested by

no test coverage detected