fast-path String in render_obj_to_output, avoid Utils.to_s dispatch for common case

This commit is contained in:
Tobi Lutke
2026-03-11 07:24:30 -04:00
parent fa412245f7
commit c1113ad2f8
+4 -3
View File
@@ -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