Skip to content

Commit 5a6d80f

Browse files
seishuncodebytere
authored andcommitted
buffer: remove hoisted variable
PR-URL: #33470 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent f495ab3 commit 5a6d80f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/buffer.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ Buffer.isEncoding = function isEncoding(encoding) {
544544
Buffer[kIsEncodingSymbol] = Buffer.isEncoding;
545545

546546
Buffer.concat = function concat(list, length) {
547-
let i;
548547
if (!ArrayIsArray(list)) {
549548
throw new ERR_INVALID_ARG_TYPE('list', 'Array', list);
550549
}
@@ -554,7 +553,7 @@ Buffer.concat = function concat(list, length) {
554553

555554
if (length === undefined) {
556555
length = 0;
557-
for (i = 0; i < list.length; i++) {
556+
for (let i = 0; i < list.length; i++) {
558557
if (list[i].length) {
559558
length += list[i].length;
560559
}
@@ -565,7 +564,7 @@ Buffer.concat = function concat(list, length) {
565564

566565
const buffer = Buffer.allocUnsafe(length);
567566
let pos = 0;
568-
for (i = 0; i < list.length; i++) {
567+
for (let i = 0; i < list.length; i++) {
569568
const buf = list[i];
570569
if (!isUint8Array(buf)) {
571570
// TODO(BridgeAR): This should not be of type ERR_INVALID_ARG_TYPE.

0 commit comments

Comments
 (0)