Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 36c541b

Browse files
committed
use Set instead of hash
1 parent a3e9198 commit 36c541b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/extension.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ async function autoUpdate() {
208208
}
209209

210210
function progressCounter() {
211-
const runningProgress: { [index: string]: boolean } = {};
211+
const runningProgress: Set<string> = new Set();
212212
const asPercent = (fraction: number): string => `${Math.round(fraction * 100)}%`;
213213
let runningDiagnostics = 0;
214214
lc.onReady().then(() => {
@@ -217,11 +217,11 @@ function progressCounter() {
217217

218218
lc.onNotification(new NotificationType('window/progress'), function (progress: any) {
219219
if (progress.done) {
220-
delete runningProgress[progress.id];
220+
runningProgress.delete(progress.id);
221221
} else {
222-
runningProgress[progress.id] = true;
222+
runningProgress.add(progress.id);
223223
}
224-
if (Object.keys(runningProgress).length) {
224+
if (runningProgress.size) {
225225
let status = '';
226226
if (typeof progress.percentage === 'number') {
227227
status = asPercent(progress.percentage);

0 commit comments

Comments
 (0)