GeezerVison is showing github.com — perf_hooks: use for...of · nodejs/node@59e2975
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/perf_hooks.js +4-6Lines changed: 4 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -322,12 +322,11 @@ class PerformanceObserver extends AsyncResource { |
322 | 322 | disconnect() { |
323 | 323 | const observerCountsGC = observerCounts[NODE_PERFORMANCE_ENTRY_TYPE_GC]; |
324 | 324 | const types = this[kTypes]; |
325 | | - const keys = ObjectKeys(types); |
326 | | - for (var n = 0; n < keys.length; n++) { |
327 | | - const item = types[keys[n]]; |
| 325 | + for (const key of ObjectKeys(types)) { |
| 326 | + const item = types[key]; |
328 | 327 | if (item) { |
329 | 328 | L.remove(item); |
330 | | - observerCounts[keys[n]]--; |
| 329 | + observerCounts[key]--; |
331 | 330 | } |
332 | 331 | } |
333 | 332 | this[kTypes] = {}; |
@@ -353,8 +352,7 @@ class PerformanceObserver extends AsyncResource { |
353 | 352 | this[kBuffer][kEntries] = []; |
354 | 353 | L.init(this[kBuffer][kEntries]); |
355 | 354 | this[kBuffering] = Boolean(options.buffered); |
356 | | - for (var n = 0; n < entryTypes.length; n++) { |
357 | | - const entryType = entryTypes[n]; |
| 355 | + for (const entryType of entryTypes) { |
358 | 356 | const list = getObserversList(entryType); |
359 | 357 | if (this[kTypes][entryType]) continue; |
360 | 358 | const item = { obs: this }; |
|