{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/io.js/issues/1891","labels_url":"https://api.github.com/repos/nodejs/io.js/issues/1891/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/io.js/issues/1891/comments","events_url":"https://api.github.com/repos/nodejs/io.js/issues/1891/events","html_url":"https://github.com/nodejs/io.js/issues/1891","id":84889205,"number":1891,"title":"Should Buffer.concat really return the source buffer when length == 1?","user":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars.githubusercontent.com/u/631240?v=3","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/io.js/labels/buffer","name":"buffer","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-06-04T03:33:08Z","updated_at":"2015-06-10T17:54:37Z","closed_at":"2015-06-10T17:41:11Z","body":"`Buffer.concat` returns a new Buffer instance that contains all given buffers combined. However, if the array of buffers that is passed has length 1, the original buffer from that array is returned as-is. Not a copy. That means that manipulation of `Buffer.concat`'s output has no effect on the source buffers have length > 1, yet alters the source buffer when length == 1.\r\n\r\nThis seems very unpredictable (Array.prototype.concat for example always returns a copy) and is bound to at least confuse people, and at worst cause weird bugs.\r\n\r\nOriginal discussion: https://github.com/nodejs/io.js/pull/1825#discussion_r31596670"},"comment":{"url":"https://api.github.com/repos/nodejs/io.js/issues/comments/110853520","html_url":"https://github.com/nodejs/io.js/issues/1891#issuecomment-110853520","issue_url":"https://api.github.com/repos/nodejs/io.js/issues/1891","id":110853520,"user":{"login":"benjamingr","id":1315533,"avatar_url":"https://avatars.githubusercontent.com/u/1315533?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamingr","html_url":"https://github.com/benjamingr","followers_url":"https://api.github.com/users/benjamingr/followers","following_url":"https://api.github.com/users/benjamingr/following{/other_user}","gists_url":"https://api.github.com/users/benjamingr/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamingr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamingr/subscriptions","organizations_url":"https://api.github.com/users/benjamingr/orgs","repos_url":"https://api.github.com/users/benjamingr/repos","events_url":"https://api.github.com/users/benjamingr/events{/privacy}","received_events_url":"https://api.github.com/users/benjamingr/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T17:54:37Z","updated_at":"2015-06-10T17:54:37Z","body":"Well @thefourtheye already got credit for being awesome yesterday in front of a thousand people - I guess saying thanks again wouldn't hurt! thanks!"}}