mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Split a line and use String#empty? for readability
This commit is contained in:
@@ -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