mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Split a line and use String#empty? for readability
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user