Skip to content

Commit 4d0656a

Browse files
authored
perf: prevent needless allocation for string (#423)
1 parent 128c747 commit 4d0656a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/redis_client/cluster/command.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def determine_first_key_position(command) # rubocop:disable Metrics/CyclomaticCo
123123

124124
def determine_optional_key_position(command, option_name)
125125
command.each_with_index do |e, i|
126-
return i + 1 if e.to_s.downcase(:ascii) == option_name
126+
return i + 1 if e.to_s.casecmp(option_name).zero?
127127
end
128128

129129
0

0 commit comments

Comments
 (0)