mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Continue Strict null check for Map.get may return undefined
This commit is contained in:
@@ -347,7 +347,7 @@ export class FileIndexSearchManager {
|
||||
this.folderCacheKeys.set(config.cacheKey!, new Set());
|
||||
}
|
||||
|
||||
this.folderCacheKeys.get(config.cacheKey!).add(folderCacheKey!);
|
||||
this.folderCacheKeys.get(config.cacheKey!)!.add(folderCacheKey!);
|
||||
|
||||
return folderCacheKey!;
|
||||
}
|
||||
@@ -553,11 +553,11 @@ export class FileIndexSearchManager {
|
||||
}
|
||||
|
||||
public clearCache(cacheKey: string): void {
|
||||
if (!this.folderCacheKeys.has(cacheKey)) {
|
||||
const expandedKeys = this.folderCacheKeys.get(cacheKey);
|
||||
if (!expandedKeys) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const expandedKeys = this.folderCacheKeys.get(cacheKey);
|
||||
expandedKeys.forEach(key => delete this.caches[key]);
|
||||
|
||||
this.folderCacheKeys.delete(cacheKey);
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as crypto from 'crypto';
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { illegalArgument } from 'vs/base/common/errors';
|
||||
import * as vscode from 'vscode';
|
||||
import { isMarkdownString } from 'vs/base/common/htmlContent';
|
||||
import { IRelativePattern } from 'vs/base/common/glob';
|
||||
import { relative } from 'path';
|
||||
import { startsWith } from 'vs/base/common/strings';
|
||||
import { values } from 'vs/base/common/map';
|
||||
import { coalesce, equals } from 'vs/base/common/arrays';
|
||||
import { illegalArgument } from 'vs/base/common/errors';
|
||||
import { IRelativePattern } from 'vs/base/common/glob';
|
||||
import { isMarkdownString } from 'vs/base/common/htmlContent';
|
||||
import { values } from 'vs/base/common/map';
|
||||
import { startsWith } from 'vs/base/common/strings';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
|
||||
export class Disposable {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user