mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
perf_hooks: use for...of
PR-URL: https://github.com/nodejs/node/pull/31049 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
7f70c2431c
commit
35b7ba6e7a
1 file changed
+4
-6
+4
-6
@@ -322,12 +322,11 @@ class PerformanceObserver extends AsyncResource {
|
||||
disconnect() {
|
||||
const observerCountsGC = observerCounts[NODE_PERFORMANCE_ENTRY_TYPE_GC];
|
||||
const types = this[kTypes];
|
||||
const keys = ObjectKeys(types);
|
||||
for (var n = 0; n < keys.length; n++) {
|
||||
const item = types[keys[n]];
|
||||
for (const key of ObjectKeys(types)) {
|
||||
const item = types[key];
|
||||
if (item) {
|
||||
L.remove(item);
|
||||
observerCounts[keys[n]]--;
|
||||
observerCounts[key]--;
|
||||
}
|
||||
}
|
||||
this[kTypes] = {};
|
||||
@@ -353,8 +352,7 @@ class PerformanceObserver extends AsyncResource {
|
||||
this[kBuffer][kEntries] = [];
|
||||
L.init(this[kBuffer][kEntries]);
|
||||
this[kBuffering] = Boolean(options.buffered);
|
||||
for (var n = 0; n < entryTypes.length; n++) {
|
||||
const entryType = entryTypes[n];
|
||||
for (const entryType of entryTypes) {
|
||||
const list = getObserversList(entryType);
|
||||
if (this[kTypes][entryType]) continue;
|
||||
const item = { obs: this };
|
||||
|
||||
Reference in new issue
Block a user