mirror of
https://github.com/github/codeql.git
synced 2025-12-29 07:06:43 +01:00
21 lines
246 B
JavaScript
21 lines
246 B
JavaScript
var cache;
|
|
|
|
function init() {
|
|
cache = {};
|
|
}
|
|
|
|
function done() {
|
|
delete cache;
|
|
}
|
|
|
|
function get(k) {
|
|
k = '$' + k;
|
|
if (!cache.hasOwnProperty(k))
|
|
cache[k] = compute(k);
|
|
return cache[k];
|
|
}
|
|
|
|
function compute(k) {
|
|
// compute value for k
|
|
// ...
|
|
} |