From: Feross Aboukhadijeh Date: Sun, 26 Oct 2014 23:05:10 +0000 (-0700) Subject: small perf improvement for `copy` X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=19fac0a8d50a830bbe25f03e83c94f67d2edc469;p=buffer.git small perf improvement for `copy` --- diff --git a/index.js b/index.js index 40d4ae0..bf25e09 100644 --- a/index.js +++ b/index.js @@ -837,7 +837,7 @@ Buffer.prototype.copy = function (target, target_start, start, end) { var len = end - start - if (len < 100 || !Buffer.TYPED_ARRAY_SUPPORT) { + if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < len; i++) { target[i + target_start] = this[i + start] }