Skip to content

Commit 7313ab3

Browse files
SukkaWThomas Parisot
authored andcommitted
refactor(fragment_cache): reuse result (hexojs#3985)
1 parent 822c739 commit 7313ab3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/plugins/helper/fragment_cache.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ module.exports = ctx => {
99
return function fragmentCache(id, fn) {
1010
if (this.cache && cache[id] != null) return cache[id];
1111

12-
cache[id] = fn();
1312
const result = fn();
13+
14+
cache[id] = result;
1415
return result;
1516
};
1617
};

0 commit comments

Comments
 (0)