MCPcopy Create free account
hub / github.com/HDT3213/rdb / readListPackEntryAsString

Method readListPackEntryAsString

core/listpack.go:185–195  ·  view source on GitHub ↗

readListPackEntryAsString return a string representation of entry It means if the entry is a integer, then format it as string

(buf []byte, cursor *int)

Source from the content-addressed store, hash-verified

183// readListPackEntryAsString return a string representation of entry
184// It means if the entry is a integer, then format it as string
185func (dec *Decoder) readListPackEntryAsString(buf []byte, cursor *int) ([]byte, error) {
186 str, intval, _, err := dec.readListPackEntry(buf, cursor)
187 if err != nil {
188 return nil, fmt.Errorf("read from failed: %v", err)
189 }
190 if str != nil {
191 return str, nil
192 }
193 str = []byte(strconv.FormatInt(intval, 10))
194 return str, nil
195}
196
197func (dec *Decoder) readListPackEntryAsInt(buf []byte, cursor *int) (int64, error) {
198 str, intval, _, err := dec.readListPackEntry(buf, cursor)

Callers 5

readListPackSetMethod · 0.95
readListPackHashMethod · 0.95
readListPackHashExMethod · 0.95
readListPackZSetMethod · 0.95

Calls 1

readListPackEntryMethod · 0.95

Tested by

no test coverage detected