lib/signore/sig_finder.rb in signore-0.4.0 vs lib/signore/sig_finder.rb in signore-0.4.1
- old
+ new
@@ -4,10 +4,10 @@
module Signore
module SigFinder
module_function
def find(sigs, random: Random.new, tags: Tags.new)
- found = sigs.shuffle(random: random).find { |sig| tags.match?(sig.tags) }
- found or Signature.new
+ shuffled = sigs.shuffle(random: random)
+ shuffled.find(-> { Signature.new }) { |sig| tags.match?(sig.tags) }
end
end
end