提交 cb637444 编写于 作者: B Benjamin Pasero

Adopt TernarySearchTree#forUris2 (#110241)

上级 438f6108
......@@ -180,6 +180,7 @@ export class FileService extends Disposable implements IFileService {
private async doResolveFile(resource: URI, options?: IResolveFileOptions): Promise<IFileStat>;
private async doResolveFile(resource: URI, options?: IResolveFileOptions): Promise<IFileStat> {
const provider = await this.withProvider(resource);
const isPathCaseSensitive = this.isPathCaseSensitive(provider);
const resolveTo = options?.resolveTo;
const resolveSingleChildDescendants = options?.resolveSingleChildDescendants;
......@@ -193,7 +194,7 @@ export class FileService extends Disposable implements IFileService {
// lazy trie to check for recursive resolving
if (!trie) {
trie = TernarySearchTree.forUris<true>();
trie = TernarySearchTree.forUris2<true>(() => !isPathCaseSensitive);
trie.set(resource, true);
if (isNonEmptyArray(resolveTo)) {
resolveTo.forEach(uri => trie!.set(uri, true));
......
......@@ -521,19 +521,19 @@ export class FileChangesEvent {
switch (change.type) {
case FileChangeType.ADDED:
if (!this.added) {
this.added = TernarySearchTree.forUris<IFileChange>(this.ignorePathCasing);
this.added = TernarySearchTree.forUris2<IFileChange>(() => this.ignorePathCasing);
}
this.added.set(change.resource, change);
break;
case FileChangeType.UPDATED:
if (!this.updated) {
this.updated = TernarySearchTree.forUris<IFileChange>(this.ignorePathCasing);
this.updated = TernarySearchTree.forUris2<IFileChange>(() => this.ignorePathCasing);
}
this.updated.set(change.resource, change);
break;
case FileChangeType.DELETED:
if (!this.deleted) {
this.deleted = TernarySearchTree.forUris<IFileChange>(this.ignorePathCasing);
this.deleted = TernarySearchTree.forUris2<IFileChange>(() => this.ignorePathCasing);
}
this.deleted.set(change.resource, change);
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册