lib/picky/query/allocation.rb in picky-4.5.3 vs lib/picky/query/allocation.rb in picky-4.5.4
- old
+ new
@@ -21,27 +21,20 @@
#
#
def initialize index, combinations
@combinations = combinations
- # Could this be rewritten?
+ # TODO Could this be rewritten?
#
@result_identifier = index.result_identifier
@backend = index.backend
end
- def hash
- @combinations.hash
- end
- # def eql? other
- # self.class == other.class && combinations.eql?(other.combinations)
- # end
-
# Asks the backend for the total score and
# adds the boosts to it.
#
- # THINK Can the combinations be empty?
+ # TODO THINK Can the combinations be empty?
#
def calculate_score weights
@score ||= if @combinations.empty?
0
else
@@ -50,10 +43,10 @@
end
end
# Asks the backend for the (intersected) ids.
#
- # THINK Can the combinations be empty?
+ # TODO THINK Can the combinations be empty?
#
def calculate_ids amount, offset
return [] if @combinations.empty?
@backend.ids @combinations, amount, offset
end
\ No newline at end of file