mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Clean up heuristic logic
This commit is contained in:
@@ -18,9 +18,7 @@ module Linguist
|
|||||||
data = blob.data
|
data = blob.data
|
||||||
|
|
||||||
@heuristics.each do |heuristic|
|
@heuristics.each do |heuristic|
|
||||||
if heuristic.matches?(languages) && result = heuristic.call(data)
|
return Array(heuristic.call(data)) if heuristic.matches?(languages)
|
||||||
return Array(result)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
[] # No heuristics matched
|
[] # No heuristics matched
|
||||||
|
|||||||
Reference in New Issue
Block a user