Skip to content
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

Merged
merged 1 commit into from Apr 12, 2018

Conversation

ashmaroli
Copy link
Member

I should've made these corrections before #6610 got merged..
Oh well.."Better late than never.."

@ashmaroli ashmaroli added this to the v3.8.0 milestone Mar 11, 2018
@ashmaroli ashmaroli requested a review from a user March 11, 2018 08:21
@@ -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
Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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..

Copy link
Member Author

@ashmaroli ashmaroli Apr 12, 2018

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..)

@pathawks
Copy link
Member

@jekyllbot: :shipit: +minor

@jekyllbot jekyllbot merged commit 8f78afe into jekyll:master Apr 12, 2018
jekyllbot added a commit that referenced this pull request Apr 12, 2018
@ashmaroli ashmaroli deleted the profile-filename-regex branch April 12, 2018 17:50
@jekyll jekyll locked and limited conversation to collaborators Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants