Skip to content

Commit

Permalink
Memoize magic comment regex (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Aug 29, 2023
1 parent 5cb9407 commit e0a081b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ruby_indexer/lib/ruby_indexer/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def files_to_index

sig { returns(Regexp) }
def magic_comment_regex
/^\s*#\s*#{@excluded_magic_comments.join("|")}/
@magic_comment_regex ||= T.let(/^\s*#\s*#{@excluded_magic_comments.join("|")}/, T.nilable(Regexp))
end

private
Expand Down

0 comments on commit e0a081b

Please sign in to comment.