Skip to content

Commit

Permalink
Merge pull request #733 from ember-cli/rwjblue-patch-1
Browse files Browse the repository at this point in the history
Avoid repeated encoding in getTemplateCompiler
  • Loading branch information
ef4 authored Oct 14, 2021
2 parents c69c8fb + 6f86813 commit 1aebd1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ function getTemplateCompiler(templateCompilerPath, EmberENV = {}) {
let cacheData = TemplateCompilerCache.get(templateCompilerFullPath);

if (cacheData === undefined) {
let templateCompilerContents = fs.readFileSync(templateCompilerFullPath, { encoding: 'utf-8' });
let templateCompilerContents = fs.readFileSync(templateCompilerFullPath);
let templateCompilerCacheKey = crypto
.createHash('md5')
.update(templateCompilerContents)
.digest('hex');

cacheData = {
script: new vm.Script(templateCompilerContents, {
script: new vm.Script(templateCompilerContents.toString(), {
filename: templateCompilerPath,
}),

Expand Down

0 comments on commit 1aebd1b

Please sign in to comment.