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

This commit is contained in:
Tobi Lutke
2026-04-04 17:33:53 -07:00
committed by Chris Pak
parent 9d9d094e20
commit e73b41f3b6
+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