the "keys have no pre-determined position" command specifies the position of the key (#1769)

This commit is contained in:
monkey92t 2021-05-28 23:15:26 +08:00 committed by GitHub
parent ad4d0a506a
commit f521e51383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -2380,6 +2380,7 @@ func (c cmdable) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd {
} }
cmd := NewStringSliceCmd(ctx, args...) cmd := NewStringSliceCmd(ctx, args...)
cmd.setFirstKeyPos(2)
_ = c(ctx, cmd) _ = c(ctx, cmd)
return cmd return cmd
} }
@ -2395,6 +2396,7 @@ func (c cmdable) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd
args[len(keys)+2] = "withscores" args[len(keys)+2] = "withscores"
cmd := NewZSliceCmd(ctx, args...) cmd := NewZSliceCmd(ctx, args...)
cmd.setFirstKeyPos(2)
_ = c(ctx, cmd) _ = c(ctx, cmd)
return cmd return cmd
} }
@ -2658,6 +2660,7 @@ func (c cmdable) MemoryUsage(ctx context.Context, key string, samples ...int) *I
args = append(args, "SAMPLES", samples[0]) args = append(args, "SAMPLES", samples[0])
} }
cmd := NewIntCmd(ctx, args...) cmd := NewIntCmd(ctx, args...)
cmd.setFirstKeyPos(2)
_ = c(ctx, cmd) _ = c(ctx, cmd)
return cmd return cmd
} }
@ -2674,6 +2677,7 @@ func (c cmdable) Eval(ctx context.Context, script string, keys []string, args ..
} }
cmdArgs = appendArgs(cmdArgs, args) cmdArgs = appendArgs(cmdArgs, args)
cmd := NewCmd(ctx, cmdArgs...) cmd := NewCmd(ctx, cmdArgs...)
cmd.setFirstKeyPos(3)
_ = c(ctx, cmd) _ = c(ctx, cmd)
return cmd return cmd
} }
@ -2688,6 +2692,7 @@ func (c cmdable) EvalSha(ctx context.Context, sha1 string, keys []string, args .
} }
cmdArgs = appendArgs(cmdArgs, args) cmdArgs = appendArgs(cmdArgs, args)
cmd := NewCmd(ctx, cmdArgs...) cmd := NewCmd(ctx, cmdArgs...)
cmd.setFirstKeyPos(3)
_ = c(ctx, cmd) _ = c(ctx, cmd)
return cmd return cmd
} }