We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 52b517f commit 3bedaf9Copy full SHA for 3bedaf9
lib/buffer.js
@@ -860,11 +860,11 @@ Buffer.prototype.equals = function equals(otherBuffer) {
860
861
if (this === otherBuffer)
862
return true;
863
-
864
- if (this.byteLength !== otherBuffer.byteLength)
+ const len = TypedArrayPrototypeGetByteLength(this);
+ if (len !== TypedArrayPrototypeGetByteLength(otherBuffer))
865
return false;
866
867
- return this.byteLength === 0 || _compare(this, otherBuffer) === 0;
+ return len === 0 || _compare(this, otherBuffer) === 0;
868
};
869
870
let INSPECT_MAX_BYTES = 50;
0 commit comments