Skip to content

Commit

Permalink
perf: prevent needless allocation for string (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal authored Dec 31, 2024
1 parent 128c747 commit 4d0656a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/redis_client/cluster/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def determine_first_key_position(command) # rubocop:disable Metrics/CyclomaticCo

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

0
Expand Down

0 comments on commit 4d0656a

Please sign in to comment.