mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Remove duplicate key check in cacheCommandOutput and related tests
This key-check is unnecessary because this function is only ever called if the key does NOT exist in the cache already. In that case, why check again?
This commit is contained in:
5
lib/entry-points.js
generated
5
lib/entry-points.js
generated
@@ -149942,11 +149942,6 @@ function writeCommandCacheFile(data) {
|
||||
}
|
||||
}
|
||||
function cacheCommandOutput(key, cmd, output) {
|
||||
if (inMemoryCache.has(key)) {
|
||||
throw new Error(
|
||||
`cacheCommandOutput() should be called only once per key, but was called more than once for '${key}'.`
|
||||
);
|
||||
}
|
||||
const entry = { cmd, output };
|
||||
inMemoryCache.set(key, entry);
|
||||
const data = readCommandCacheFile();
|
||||
|
||||
Reference in New Issue
Block a user