]> zoso.dev Git - buffer.git/commitdiff
Remove special-case copy() for len < 1000
authorFeross Aboukhadijeh <feross@feross.org>
Fri, 16 Feb 2018 06:21:51 +0000 (22:21 -0800)
committerFeross Aboukhadijeh <feross@feross.org>
Fri, 16 Feb 2018 06:21:51 +0000 (22:21 -0800)
For https://github.com/feross/buffer/issues/174

index.js

index 0e45b2ad69ff98c4b2a4aa782d8a2b1d89832437..7f67ccbc69d5f4105c2888fb85699e3dc6cef18f 100644 (file)
--- 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,