MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdLSET

Function cmdLSET

lists.go:307–321  ·  view source on GitHub ↗
(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

305 n, err := ldb.LLen([]byte(args[1]))
306 if err != nil {
307 return nil, err
308 }
309 return redcon.SimpleInt(n), nil
310}
311
312func cmdLSET(m uhaha.Machine, args []string) (interface{}, error) {
313 if len(args) != 4 {
314 return nil, uhaha.ErrWrongNumArgs
315 }
316
317 index, err := ledis.StrInt64([]byte(args[2]), nil)
318 if err != nil {
319 return nil, err
320 }
321
322 if err := ldb.LSet([]byte(args[1]), int32(index), []byte(args[3])); err != nil {
323 return nil, err
324 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected