Skip to content

Commit

Permalink
- duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Sep 6, 2012
1 parent c16845f commit 1441c53
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions server/lib/picky/backends/redis.rb
Expand Up @@ -248,27 +248,14 @@ def ids combinations, amount, offset
end
end
end
# Call the newly installed version.
#
ids combinations, amount, offset
else
class << self
def ids combinations, _, _
# Get the ids for each combination.
#
id_arrays = combinations.inject([]) do |total, combination|
total << combination.ids
end

# Call the optimized C algorithm.
#
# Note: It orders the passed arrays by size.
#
Performant::Array.memory_efficient_intersect id_arrays
end
end
# Simply super call.
#
super
end

# Call the newly installed version.
#
ids combinations, amount, offset
end

# Generate a multiple host/process safe result id.
Expand Down

0 comments on commit 1441c53

Please sign in to comment.