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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if site is in incremental mode optimally #8401

Merged
merged 1 commit into from
Sep 24, 2020

Conversation

ashmaroli
Copy link
Member

  • This is a 馃敤 code refactoring change.

Summary

Jekyll::Site#incremental? takes an optional argument which is an empty Hash by default:

jekyll/lib/jekyll/site.rb

Lines 367 to 369 in f8c7208

def incremental?(override = {})
override["incremental"] || config["incremental"]
end

Since the empty hash is a default parameter, every call to the method allocates an empty Hash.
Therefore, calling the method while rendering an include file can allocate numerous Hashes unnecessarily.

The solution is then to access the config value directly.

@ashmaroli ashmaroli added the fix label Sep 18, 2020
@ashmaroli ashmaroli added this to the 4.2 milestone Sep 18, 2020
@ashmaroli
Copy link
Member Author

Thank you @DirtyF :)
@jekyllbot: merge +fix

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

3 participants