lib/picky/query/indexes.rb in picky-4.5.3 vs lib/picky/query/indexes.rb in picky-4.5.4
- old
+ new
@@ -60,12 +60,14 @@
# Returns a number of prepared (sorted, reduced etc.) allocations for the given tokens.
#
def prepared_allocations_for tokens, weights = {}, amount = nil
allocations = allocations_for tokens
- # Remove double allocations.
+ # Removed: Remove potential double allocations.
#
- allocations.uniq
+ # Note: allocations are unique by definition.
+ #
+ # allocations.uniq! unless tokens.uniq?
# Score the allocations using weights as bias.
#
allocations.calculate_score weights
\ No newline at end of file