Use optional chaining for more method calls (#156938)

This rewrites code such as:

```ts
if (thing) {
    thing.method();
}
```

To the more concise:

```ts
thing?.method();
```

This was done using a simple find replace. I tried to keep the change pretty conservative so it only touches simple cases like above
This commit is contained in:
Matt Bierner
2022-08-02 16:56:56 -07:00
committed by GitHub
parent c07ff2eb1d
commit 342394d1e7
127 changed files with 198 additions and 594 deletions

View File

@@ -620,9 +620,7 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo
$deleteCommentThread(threadHandle: number): void {
const thread = this._threads.get(threadHandle);
if (thread) {
thread.dispose();
}
thread?.dispose();
this._threads.delete(threadHandle);
}