Fix Performance/MapMethodChain
cop (#27744)
This commit is contained in:
parent
bbad5b6456
commit
45770c9306
5 changed files with 13 additions and 20 deletions
|
@ -23,9 +23,9 @@ class Feed
|
|||
max_id = '+inf' if max_id.blank?
|
||||
if min_id.blank?
|
||||
since_id = '-inf' if since_id.blank?
|
||||
unhydrated = redis.zrevrangebyscore(key, "(#{max_id}", "(#{since_id}", limit: [0, limit], with_scores: true).map(&:first).map(&:to_i)
|
||||
unhydrated = redis.zrevrangebyscore(key, "(#{max_id}", "(#{since_id}", limit: [0, limit], with_scores: true).map { |id| id.first.to_i }
|
||||
else
|
||||
unhydrated = redis.zrangebyscore(key, "(#{min_id}", "(#{max_id}", limit: [0, limit], with_scores: true).map(&:first).map(&:to_i)
|
||||
unhydrated = redis.zrangebyscore(key, "(#{min_id}", "(#{max_id}", limit: [0, limit], with_scores: true).map { |id| id.first.to_i }
|
||||
end
|
||||
|
||||
Status.where(id: unhydrated).cache_ids
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue