From eee5e8eee744c828f439074bbf532b4f7565a2e0 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 1 Mar 2023 13:27:08 +1100 Subject: [PATCH] Remove unnecessary tag rule code The applicator converts the input to an array, even `nil` becomes an empty array. Iterating over an empty array doesn't do anything either, the result is the same. --- lib/open_food_network/tag_rule_applicator.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/open_food_network/tag_rule_applicator.rb b/lib/open_food_network/tag_rule_applicator.rb index 09060a8ecf..b606e57438 100644 --- a/lib/open_food_network/tag_rule_applicator.rb +++ b/lib/open_food_network/tag_rule_applicator.rb @@ -14,8 +14,6 @@ module OpenFoodNetwork end def filter!(subject) - return unless subject.respond_to?(:any?) && subject.any? - subject.to_a.reject! do |element| if rule_class.respond_to?(:tagged_children_for) children = rule_class.tagged_children_for(element)