lib/linguist/heuristics.rb in github-linguist-4.2.0 vs lib/linguist/heuristics.rb in github-linguist-4.2.1
- old
+ new
@@ -51,10 +51,10 @@
@heuristic = heuristic
end
# Internal: Check if this heuristic matches the candidate languages.
def matches?(candidates)
- candidates.all? { |l| @languages.include?(l.name) }
+ candidates.any? && candidates.all? { |l| @languages.include?(l.name) }
end
# Internal: Perform the heuristic
def call(data)
@heuristic.call(data)