mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -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
|
||||
|
||||
def render_obj_to_output(obj, output)
|
||||
case obj
|
||||
when NilClass
|
||||
if obj.instance_of?(String)
|
||||
output << obj
|
||||
elsif obj.nil?
|
||||
# Do nothing
|
||||
when Array
|
||||
elsif obj.instance_of?(Array)
|
||||
obj.each do |o|
|
||||
render_obj_to_output(o, output)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user