Skip to content

Commit

Permalink
refactor(fragment_cache): reuse result (#3985)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW authored Dec 18, 2019
1 parent 5179a6a commit 9322cb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/helper/fragment_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ module.exports = ctx => {
return function fragmentCache(id, fn) {
if (this.cache && cache[id] != null) return cache[id];

cache[id] = fn();
const result = fn();

cache[id] = result;
return result;
};
};

0 comments on commit 9322cb6

Please sign in to comment.