Skip to content

Commit 8941f2d

Browse files
authored
Optimize FuncitonRegistry
1 parent d2173a1 commit 8941f2d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/sass/compiler/host/function_registry.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ class FunctionRegistry
1010
attr_reader :compile_context, :global_functions
1111

1212
def initialize(functions, alert_color:)
13-
functions = functions.transform_keys(&:to_s)
14-
15-
@compile_context = Object.new
16-
@global_functions = functions.keys
13+
@compile_context = Object.new.freeze
14+
@global_functions = functions.keys.map(&:to_s)
1715
@functions_by_name = functions.transform_keys do |signature|
16+
signature = signature.to_s
1817
index = signature.index('(')
1918
if index
2019
signature.slice(0, index)

0 commit comments

Comments
 (0)