From: Feross Aboukhadijeh Date: Fri, 16 Feb 2018 06:21:51 +0000 (-0800) Subject: Remove special-case copy() for len < 1000 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=94175536ff6d25df2c2c161296d104c10300eef0;p=buffer.git Remove special-case copy() for len < 1000 For https://github.com/feross/buffer/issues/174 --- diff --git a/index.js b/index.js index 0e45b2a..7f67ccb 100644 --- a/index.js +++ b/index.js @@ -1497,11 +1497,6 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) { for (i = len - 1; i >= 0; --i) { target[i + targetStart] = this[i + start] } - } else if (len < 1000) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start] - } } else { Uint8Array.prototype.set.call( target,