mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Reduce allocations while registering Liquid tags
This commit is contained in:
@@ -50,7 +50,9 @@ module Liquid
|
||||
private
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user