diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 07972019..2353edd1 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -110,16 +110,16 @@ module Linguist # Bail early if the blob is binary or empty. return nil if blob.likely_binary? || blob.binary? || blob.empty? - # Call each strategy until one candidate is returned + # Call each strategy until one candidate is returned. STRATEGIES.reduce([]) do |languages, strategy| candidates = strategy.call(blob, languages) if candidates.size == 1 return candidates.first elsif candidates.size > 1 - # More than one candidate was found, pass them to the next strategy + # More than one candidate was found, pass them to the next strategy. candidates else - # Strategy couldn't find any candidates, so pass on the original list + # No candiates were found, pass on languages from the previous strategy. languages end end.first