From 0c465f0857f7875ae995896ac850fa0df4c637c7 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 20 Apr 2015 13:51:00 -0700 Subject: [PATCH] match iojs Buffer.concat signature --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index bbb7343..ba03fc2 100644 --- a/index.js +++ b/index.js @@ -178,7 +178,7 @@ Buffer.isEncoding = function isEncoding (encoding) { } } -Buffer.concat = function concat (list, totalLength) { +Buffer.concat = function concat (list, length) { if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') if (list.length === 0) { @@ -188,14 +188,14 @@ Buffer.concat = function concat (list, totalLength) { } var i - if (totalLength === undefined) { - totalLength = 0 + if (length === undefined) { + length = 0 for (i = 0; i < list.length; i++) { - totalLength += list[i].length + length += list[i].length } } - var buf = new Buffer(totalLength) + var buf = new Buffer(length) var pos = 0 for (i = 0; i < list.length; i++) { var item = list[i] -- 2.34.1