Change getInterleavedArguments function

This commit is contained in:
ofekshenawa 2024-09-23 01:37:41 +03:00
parent be805cbe10
commit a5fdfa2ec8
2 changed files with 4 additions and 4 deletions

View File

@ -210,9 +210,9 @@ func (cmd *baseCmd) readRawReply(rd *proto.Reader) (err error) {
return err
}
// getInterleavedArguments returns arguments at even indices starting from index 0.
// getInterleavedArguments returns arguments at even indices starting from index 1.
func (cmd *baseCmd) getInterleavedArguments() []string {
return cmd.getInterleavedArgumentsWithOffset(0)
return cmd.getInterleavedArgumentsWithOffset(1)
}
// getInterleavedArgumentsWithOffset returns arguments at even indices starting from the specified offset.

View File

@ -151,7 +151,7 @@ func (c cmdable) MSet(ctx context.Context, values ...interface{}) *StatusCmd {
args[0] = "mset"
args = appendArgs(args, values)
cmd := NewStatusCmd(ctx, args...)
cmd.keys = append(cmd.keys, cmd.getInterleavedArgumentsWithOffset(1)...)
cmd.keys = append(cmd.keys, cmd.getInterleavedArguments()...)
_ = c(ctx, cmd)
return cmd
}
@ -166,7 +166,7 @@ func (c cmdable) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd {
args[0] = "msetnx"
args = appendArgs(args, values)
cmd := NewBoolCmd(ctx, args...)
cmd.keys = append(cmd.keys, cmd.getInterleavedArgumentsWithOffset(1)...)
cmd.keys = append(cmd.keys, cmd.getInterleavedArguments()...)
_ = c(ctx, cmd)
return cmd
}