Skip to content

Commit

Permalink
revert change for issue comment testing
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderMiguel committed Jan 16, 2024
1 parent 2c6aa8e commit 249b9b3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/mock_redis/set_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ def srandmember(key, count = nil)
end

def srem(key, members)
members = Array(members).map(&:to_s)

with_set_at(key) do |s|
if members.is_a?(Array)
orig_size = s.size
members = members.map(&:to_s)
s.delete_if { |m| members.include?(m) }
orig_size - s.size
if members.size > 1 || redis_gem_v5?
size_after(s) { s.delete_if { |m| members.include?(m) } }
else
s.delete?(members.to_s) ? 1 : 0
!!s.delete?(members.first)
end
end
end
Expand Down

0 comments on commit 249b9b3

Please sign in to comment.