New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize computing filename in LiquidRenderer #6841
Conversation
@@ -53,7 +53,7 @@ def self.format_error(e, path) | |||
private | |||
|
|||
def filename_regex | |||
%r!\A(#{source_dir}/|#{theme_dir}/|\W*)(.*)!oi | |||
@filename_regex ||= %r!\A(#{source_dir}/|#{theme_dir}/|\W*)(.*)!i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious: Why did you get rid of the o
modifier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The o
modifier stands for "interpolate once" which I feel is *unnecessary" when the regex itself is going to be created once per Site
instance since the entire method has now been memoized..
def_delegator :@site, :in_source_dir, :source_dir | ||
def_delegator :@site, :in_theme_dir, :theme_dir | ||
private def_delegator :@site, :in_source_dir, :source_dir | ||
private def_delegator :@site, :in_theme_dir, :theme_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recognize that these were always meant to be private, but at this point would it be easier to punt this until v4.0.0
? Or is this necessary for this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These attributes have not been released yet.. I added them in #6610..
So they can be safely altered..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(this is therefore just a fix
as well..)
@jekyllbot: +minor |
I should've made these corrections before #6610 got merged..
Oh well.."Better late than never.."