Split a line and use String#empty? for readability

This commit is contained in:
Dylan Thacker-Smith
2015-05-28 12:55:04 -04:00
parent e790b60f60
commit 873eddbb85

View File

@@ -17,7 +17,9 @@ module Liquid
index = 0
# Maintains Ruby 1.8.7 String#each behaviour on 1.9
return collection != ''.freeze ? [collection] : [] if collection.is_a?(String)
if collection.is_a?(String)
return collection.empty? ? [] : [collection]
end
collection.each do |item|
if to && to <= index