From 4f92d620eb215ed82f49a70108253b3fd9446e02 Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Thu, 29 Jan 2015 16:28:20 -0600 Subject: [PATCH] Simplify detect --- lib/linguist/strategy/modeline.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/linguist/strategy/modeline.rb b/lib/linguist/strategy/modeline.rb index 176bd292..6a07fe3f 100644 --- a/lib/linguist/strategy/modeline.rb +++ b/lib/linguist/strategy/modeline.rb @@ -15,11 +15,7 @@ module Linguist # Returns an Array with one Language if the blob has a Vim or Emacs modeline # that matches a Language name or alias. Returns an empty array if no match. def self.call(blob, _ = nil) - if language = Language.find_by_alias(modeline(blob.data)) - return [language] - else - return [] - end + Array(Language.find_by_alias(modeline(blob.data))) end # Public: Get the modeline from the first n-lines of the file