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

Adopt TernarySearchTree#forUris2 (#110241)

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