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 and andyw8 committed Sep 5, 2023
1 parent 60014ad commit d837e23
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 d837e23

Please sign in to comment.