We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33704c4 commit 2aaa6d3Copy full SHA for 2aaa6d3
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 = this.byteLength;
+ if (len !== otherBuffer.byteLength)
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