Skip to content

Commit

Permalink
Fixing the special case in Buffer.concat
Browse files Browse the repository at this point in the history
  • Loading branch information
itu2n1i8w authored and feross committed Aug 5, 2015
1 parent 0deabd1 commit a11372c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ Buffer.concat = function concat (list, length) {

if (list.length === 0) {
return new Buffer(0)
} else if (list.length === 1) {
return list[0]
}

var i
Expand Down
2 changes: 1 addition & 1 deletion test/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test('concat() a varying number of buffers', function (t) {

t.equal(flatZero.length, 0)
t.equal(flatOne.toString(), 'asdf')
t.equal(flatOne, one[0])
t.deepEqual(flatOne, one[0])
t.equal(flatLong.toString(), (new Array(10 + 1).join('asdf')))
t.equal(flatLongLen.toString(), (new Array(10 + 1).join('asdf')))
t.end()
Expand Down

0 comments on commit a11372c

Please sign in to comment.