mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-02-12 11:19:31 +00:00
Removing inconsistency of find_by_heuristics (was sometimes returning nil and sometimes returning and empty array)
This commit is contained in:
@@ -13,6 +13,8 @@ module Linguist
|
|||||||
# Returns an array of Languages or []
|
# Returns an array of Languages or []
|
||||||
def self.find_by_heuristics(data, languages)
|
def self.find_by_heuristics(data, languages)
|
||||||
if active?
|
if active?
|
||||||
|
result = []
|
||||||
|
|
||||||
if languages.all? { |l| ["Perl", "Prolog"].include?(l) }
|
if languages.all? { |l| ["Perl", "Prolog"].include?(l) }
|
||||||
result = disambiguate_pl(data)
|
result = disambiguate_pl(data)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user