Use symbols for filter names now that ruby has symbol GC

This commit is contained in:
Dylan Thacker-Smith
2020-08-20 10:06:17 -04:00
parent 5532df880f
commit 89d206d8c6
5 changed files with 35 additions and 28 deletions
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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