mirror of
https://github.com/redis/go-redis.git
synced 2025-04-17 20:17:02 +03:00
Remove extractKeys function
This commit is contained in:
parent
8de72d6d3c
commit
be805cbe10
24
command.go
24
command.go
@ -122,30 +122,6 @@ func cmdString(cmd Cmder, val interface{}) string {
|
|||||||
return util.BytesToString(b)
|
return util.BytesToString(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
func extractKeys(cmd Cmder) []string {
|
|
||||||
firstKeyPos := cmdFirstKeyPos(cmd)
|
|
||||||
if firstKeyPos == -1 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
args := cmd.Args()
|
|
||||||
keys := []string{}
|
|
||||||
|
|
||||||
switch cmd.Name() {
|
|
||||||
case "mget":
|
|
||||||
for i := int(firstKeyPos); i < len(args); i++ {
|
|
||||||
keys = append(keys, cmd.stringArg(i))
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
if int(firstKeyPos) < len(args) {
|
|
||||||
keys = append(keys, cmd.stringArg(firstKeyPos))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return keys
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
type baseCmd struct {
|
type baseCmd struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user