Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle delete of empty list of keys #998

Merged
merged 6 commits into from Jul 1, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/redis.rb
Expand Up @@ -555,6 +555,10 @@ def migrate(key, options)
# @param [String, Array<String>] keys
# @return [Integer] number of keys that were deleted
def del(*keys)
if keys.is_a?(Array) && keys.empty?
return 0
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if keys.is_a?(Array) && keys.empty?
return 0
end
return 0 if keys.empty?

keys can't be anything else than an array.


synchronize do |client|
client.call([:del] + keys)
end
Expand Down