From: Nikolai Vavilov Date: Fri, 1 May 2020 18:14:40 +0000 (+0300) Subject: Remove descending copy from end X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=5c5325913cb3860278ff761f8c8d4a77132cffd7;p=buffer.git Remove descending copy from end Uint8Array.prototype.set handles overlapping ranges on its own. --- diff --git a/index.js b/index.js index e87bfaa..9743883 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,