| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d138e2d commit c705a8e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,6 +129,8 @@ function emitInitNative(asyncId, type, triggerAsyncId, resource) { | |||
| 129 | 129 | active_hooks.call_depth += 1; | |
| 130 | 130 | // Use a single try/catch for all hooks to avoid setting up one per iteration. | |
| 131 | 131 | try { | |
| 132 | + // Using var here instead of let because "for (var ...)" is faster than let. | ||
| 133 | + // Refs: https://github.com/nodejs/node/pull/30380#issuecomment-552948364 | ||
| 132 | 134 | for (var i = 0; i < active_hooks.array.length; i++) { | |
| 133 | 135 | if (typeof active_hooks.array[i][init_symbol] === 'function') { | |
| 134 | 136 | active_hooks.array[i][init_symbol]( | |
@@ -159,6 +161,8 @@ function emitHook(symbol, asyncId) { | |||
| 159 | 161 | // Use a single try/catch for all hook to avoid setting up one per | |
| 160 | 162 | // iteration. | |
| 161 | 163 | try { | |
| 164 | + // Using var here instead of let because "for (var ...)" is faster than let. | ||
| 165 | + // Refs: https://github.com/nodejs/node/pull/30380#issuecomment-552948364 | ||
| 162 | 166 | for (var i = 0; i < active_hooks.array.length; i++) { | |
| 163 | 167 | if (typeof active_hooks.array[i][symbol] === 'function') { | |
| 164 | 168 | active_hooks.array[i][symbol](asyncId); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments