Removing inconsistency of find_by_heuristics (was sometimes returning nil and sometimes returning and empty array)

This commit is contained in:
Arfon Smith
2014-11-06 14:08:42 -06:00
parent 0ab88919c9
commit f4c7661cc6

View File

@@ -13,6 +13,8 @@ module Linguist
# Returns an array of Languages or []
def self.find_by_heuristics(data, languages)
if active?
result = []
if languages.all? { |l| ["Perl", "Prolog"].include?(l) }
result = disambiguate_pl(data)
end