We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d0656a commit 3dd83b2Copy full SHA for 3dd83b2
lib/redis_client/cluster/command.rb
@@ -122,11 +122,8 @@ def determine_first_key_position(command) # rubocop:disable Metrics/CyclomaticCo
122
end
123
124
def determine_optional_key_position(command, option_name)
125
- command.each_with_index do |e, i|
126
- return i + 1 if e.to_s.casecmp(option_name).zero?
127
- end
128
-
129
- 0
+ i = command.index { |v| v.to_s.casecmp(option_name).zero? }
+ i.nil? ? 0 : i + 1
130
131
132
0 commit comments