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
|
||||
|
||||
@heuristics.each do |heuristic|
|
||||
if heuristic.matches?(languages) && result = heuristic.call(data)
|
||||
return Array(result)
|
||||
end
|
||||
return Array(heuristic.call(data)) if heuristic.matches?(languages)
|
||||
end
|
||||
|
||||
[] # No heuristics matched
|
||||
|
||||
Reference in New Issue
Block a user