Skip to content

Commit

Permalink
check only if element is included
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoAntequera committed Aug 21, 2023
1 parent 42f075a commit 78f0d0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/kredis/types/ordered_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def remove(*elements)
zrem(types_to_strings(elements, typed))
end

def include?(*elements)
zrank(type_to_string(elements, typed)).present?
def include?(element)
zrank(type_to_string(element, typed)).present?
end

def prepend(elements)
Expand Down
4 changes: 2 additions & 2 deletions test/types/ordered_set_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class OrderedSetTest < ActiveSupport::TestCase

@set.append(%w[ 1 2 3 4 5 ])

assert @set.include?(1, 4)
assert_not @set.include?(3, 6)
assert @set.include?(1)
assert_not @set.include?(6)
end

test "appending over limit" do
Expand Down

0 comments on commit 78f0d0d

Please sign in to comment.