mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
fast-path String in render_obj_to_output, avoid Utils.to_s dispatch for common case
This commit is contained in:
@@ -111,10 +111,11 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render_obj_to_output(obj, output)
|
def render_obj_to_output(obj, output)
|
||||||
case obj
|
if obj.instance_of?(String)
|
||||||
when NilClass
|
output << obj
|
||||||
|
elsif obj.nil?
|
||||||
# Do nothing
|
# Do nothing
|
||||||
when Array
|
elsif obj.instance_of?(Array)
|
||||||
obj.each do |o|
|
obj.each do |o|
|
||||||
render_obj_to_output(o, output)
|
render_obj_to_output(o, output)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user