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 d525f28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/buffer.js
Original file line number Diff line number Diff line change
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 d525f28

Please sign in to comment.