Skip to content

Commit

Permalink
fix: specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Amnesthesia committed Nov 2, 2023
1 parent 0c9b08b commit 140f813
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/sidekiq_unique_jobs/redis/sorted_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ class SortedSet < Entity
# @return [Hash] when given with_scores: true
#
def entries(with_scores: true)
entrys = redis do |conn|
next conn.zrange(key, 0, -1, 'withscores') if with_scores
conn.zrange(key, 0, -1)
end
return entrys unless with_scores

entrys.each_with_object({}) { |pair, hash| hash[pair[0]] = pair[1] }
return redis { |conn| conn.zrange(key, 0, -1) } unless with_scores
redis { |conn| conn.zrange(key, 0, -1, 'withscores') }.each_with_object({}) { |pair, hash| hash[pair[0]] = pair[1] }
end

#
Expand Down

0 comments on commit 140f813

Please sign in to comment.