From 27bd0dbe7301bfc655b028b032db604ff0492ded Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Tue, 4 May 2021 22:45:59 +0800 Subject: [PATCH] buffer: remove unreachable code PR-URL: https://github.com/nodejs/node/pull/38537 Reviewed-By: Rich Trott Reviewed-By: James M Snell --- lib/buffer.js | 3 --- 1 file changed, 3 deletions(-) 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;