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

Avoid repeated encoding in getTemplateCompiler #733

Merged
merged 2 commits into from
Oct 14, 2021
Merged

Avoid repeated encoding in getTemplateCompiler #733

merged 2 commits into from
Oct 14, 2021

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 16, 2021

crypto.createHash('md5').update(...) takes a buffer. The prior code would read the file as a string then convert back to a buffer. Now we only convert to a string for new vm.Script() which requires a string. tldr; we convert back and forth from a buffer to a string one less time with the code change here.

`crypto.createHash('md5').update(...)` takes a buffer. The prior code would read the file as a string _then_ convert back to a buffer. Now we only convert to a string for `new vm.Script()` which _requires_ a string. tldr; we convert back and forth from a buffer to a string one less time with the code change here.
Copy link
Contributor

@krisselden krisselden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code argument of vm.Script does get converted into a string but I think this is better anyway

@ef4 ef4 merged commit 1aebd1b into master Oct 14, 2021
@delete-merged-branch delete-merged-branch bot deleted the rwjblue-patch-1 branch October 14, 2021 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants