diff --git a/lib/buffer.js b/lib/buffer.js index da9354e2d1f9e6..bb4710d3682d34 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -252,10 +252,7 @@ function _copyActual(source, target, targetStart, sourceStart, sourceEnd) { sourceEnd = sourceStart + target.length - targetStart; let nb = sourceEnd - sourceStart; - const targetLen = target.length - targetStart; const sourceLen = source.length - sourceStart; - if (nb > targetLen) - nb = targetLen; if (nb > sourceLen) nb = sourceLen;