Bail earlier if the file is empty.

This will change behavior for empty files with unique extensions, returning nil instead of the language.
This commit is contained in:
Brandon Keepers
2014-11-06 14:49:24 -06:00
parent f22524a615
commit df55043500
3 changed files with 10 additions and 10 deletions

View File

@@ -147,6 +147,13 @@ module Linguist
end
end
# Public: Is the blob empty?
#
# Return true or false
def empty?
data.nil? || data == ""
end
# Public: Is the blob text?
#
# Return true or false