Skip to content

Commit

Permalink
Apply range_start optimization in SortedSet class
Browse files Browse the repository at this point in the history
  • Loading branch information
leaexplores committed Jan 14, 2016
1 parent 57ca17f commit 1e351b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sidekiq/api.rb
Expand Up @@ -227,7 +227,7 @@ def each

while true do
range_start = page * page_size - deleted_size
range_end = range_start + (page_size - 1)
range_end = range_start + page_size - 1
entries = Sidekiq.redis do |conn|
conn.lrange @rname, range_start, range_end
end
Expand Down Expand Up @@ -502,7 +502,7 @@ def each

while true do
range_start = page * page_size + offset_size
range_end = page * page_size + offset_size + (page_size - 1)
range_end = range_start + page_size - 1
elements = Sidekiq.redis do |conn|
conn.zrange name, range_start, range_end, with_scores: true
end
Expand Down

0 comments on commit 1e351b9

Please sign in to comment.