Skip to content

Commit 03b252a

Browse files
dlongleydavidlehn
authored andcommitted
Only compute key when necessary.
1 parent 84d1d2b commit 03b252a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ActiveContextCache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ module.exports = class ActiveContextCache {
1818
}
1919

2020
get(activeCtx, localCtx) {
21-
const key = JSON.stringify(localCtx);
2221
const level1 = this.cache.get(activeCtx);
2322
if(level1) {
23+
const key = JSON.stringify(localCtx);
2424
const result = level1.get(key);
2525
return result || null;
2626
}

0 commit comments

Comments
 (0)