Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Jul 28, 2024
1 parent d873843 commit 509b66d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const {
MathFloor,
MathMin,
MathTrunc,
NumberIsNaN,
NumberIsInteger,
NumberIsNaN,
NumberMAX_SAFE_INTEGER,
NumberMIN_SAFE_INTEGER,
ObjectDefineProperties,
Expand Down Expand Up @@ -235,9 +235,6 @@ function _copy(source, target, targetStart, sourceStart, sourceEnd) {
throw new ERR_OUT_OF_RANGE('sourceEnd', '>= 0', sourceEnd);
}

if (targetStart >= target.length || sourceStart >= sourceEnd)
return 0;

return _copyActual(source, target, targetStart, sourceStart, sourceEnd);
}

Expand All @@ -250,6 +247,9 @@ function _copyActual(source, target, targetStart, sourceStart, sourceEnd) {
if (nb > sourceLen)
nb = sourceLen;

if (nb === 0)
return 0;

if (sourceStart !== 0 || sourceEnd < source.length) {
copyArrayBuffer(
target.buffer,
Expand Down

0 comments on commit 509b66d

Please sign in to comment.