mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 18:30:40 -07:00
Use symbols for filter names now that ruby has symbol GC
This commit is contained in:
@@ -24,17 +24,17 @@ module Liquid
|
||||
|
||||
include(filter)
|
||||
|
||||
filter_methods.merge(filter.public_instance_methods.map(&:to_s))
|
||||
filter.public_instance_methods.each { |name| filter_methods[name] = true }
|
||||
end
|
||||
|
||||
def invokable?(method)
|
||||
filter_methods.include?(method.to_s)
|
||||
filter_methods.key?(method.to_sym)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def filter_methods
|
||||
@filter_methods ||= Set.new
|
||||
@filter_methods ||= {}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ module Liquid
|
||||
filter_args << Expression.parse(a)
|
||||
end
|
||||
end
|
||||
result = [filter_name, filter_args]
|
||||
result = [filter_name.to_sym, filter_args]
|
||||
result << keyword_args if keyword_args
|
||||
result
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user