From a5fdfa2ec830724eec28969ac2663ac25d34b8ea Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 23 Sep 2024 01:37:41 +0300 Subject: [PATCH] Change getInterleavedArguments function --- command.go | 4 ++-- string_commands.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/command.go b/command.go index d4323773..1644b8ab 100644 --- a/command.go +++ b/command.go @@ -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. diff --git a/string_commands.go b/string_commands.go index 292dfb32..d9d1d90a 100644 --- a/string_commands.go +++ b/string_commands.go @@ -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 }