]> zoso.dev Git - buffer.git/commitdiff
small perf improvement for `copy`
authorFeross Aboukhadijeh <feross@feross.org>
Sun, 26 Oct 2014 23:05:10 +0000 (16:05 -0700)
committerFeross Aboukhadijeh <feross@feross.org>
Sun, 26 Oct 2014 23:05:10 +0000 (16:05 -0700)
index.js

index 40d4ae00bf6120a19e58962303e2c179b6608df0..bf25e09cb4473b8cabd3bad0c954c6cac6e7c204 100644 (file)
--- 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]
     }