Skip to content

Commit

Permalink
refactor: create map instance only once
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Feb 20, 2022
1 parent 96fe4ac commit 45deb74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/run/batchWarnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface BatchWarnings {

export default function batchWarnings(): BatchWarnings {
let count = 0;
let deferredWarnings = new Map<keyof typeof deferredHandlers, RollupWarning[]>();
const deferredWarnings = new Map<keyof typeof deferredHandlers, RollupWarning[]>();
let warningOccurred = false;

return {
Expand Down Expand Up @@ -59,7 +59,7 @@ export default function batchWarnings(): BatchWarnings {
deferredHandlers[code](deferredWarnings.get(code)!);
}

deferredWarnings = new Map();
deferredWarnings.clear();
count = 0;
},

Expand Down

0 comments on commit 45deb74

Please sign in to comment.