mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 10:52:48 -07:00
Reduce allocations while registering Liquid tags
This commit is contained in:
@@ -50,7 +50,9 @@ module Liquid
|
|||||||
private
|
private
|
||||||
|
|
||||||
def lookup_class(name)
|
def lookup_class(name)
|
||||||
name.split("::").reject(&:empty?).reduce(Object) { |scope, const| scope.const_get(const) }
|
names = name.split("::".freeze)
|
||||||
|
names.reject!(&:empty?)
|
||||||
|
names.reduce(Object) { |scope, const| scope.const_get(const) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user