diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-01-06 21:45:23 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-06 21:45:23 +0900 |
commit | ff89ff4abba39ce158056d390e761495f5a7bc86 (patch) | |
tree | 03a9c71b5bb3889842db06ed41c3999074c4107a /runtime/js/12_io.js | |
parent | 39cbaa6d34c249afc4b197836da1fa6dd143cbf9 (diff) |
perf(ext,runtime): remove using `SafeArrayIterator` from `for-of` (#17255)
Diffstat (limited to 'runtime/js/12_io.js')
-rw-r--r-- | runtime/js/12_io.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/js/12_io.js b/runtime/js/12_io.js index b384e1528..f6b2d6b87 100644 --- a/runtime/js/12_io.js +++ b/runtime/js/12_io.js @@ -12,7 +12,6 @@ Uint8Array, ArrayPrototypePush, MathMin, - SafeArrayIterator, TypedArrayPrototypeSubarray, TypedArrayPrototypeSet, } = window.__bootstrap.primordials; @@ -157,14 +156,15 @@ function concatBuffers(buffers) { let totalLen = 0; - for (const buf of new SafeArrayIterator(buffers)) { - totalLen += buf.byteLength; + for (let i = 0; i < buffers.length; ++i) { + totalLen += buffers[i].byteLength; } const contents = new Uint8Array(totalLen); let n = 0; - for (const buf of new SafeArrayIterator(buffers)) { + for (let i = 0; i < buffers.length; ++i) { + const buf = buffers[i]; TypedArrayPrototypeSet(contents, buf, n); n += buf.byteLength; } |