From 5c5325913cb3860278ff761f8c8d4a77132cffd7 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Fri, 1 May 2020 21:14:40 +0300 Subject: [PATCH] Remove descending copy from end Uint8Array.prototype.set handles overlapping ranges on its own. --- index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/index.js b/index.js index e87bfaaa..97438834 100644 --- a/index.js +++ b/index.js @@ -1543,11 +1543,6 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { // Use built-in when available, missing from IE11 this.copyWithin(targetStart, start, end) - } else if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (var i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } } else { Uint8Array.prototype.set.call( target,