Skip to content

Commit

Permalink
Optimize _.isEqual DataView comparison (#2875)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Sep 21, 2020
1 parent 3e7cb29 commit 00d64f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
5 changes: 2 additions & 3 deletions modules/isEqual.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ function deepEq(a, b, aStack, bStack) {
return deepEq(toDataView(a), toDataView(b), aStack, bStack);
case '[object DataView]':
var byteLength = getByteLength(a);
if (byteLength !== getByteLength(b)) {
return false;
}
if (byteLength !== getByteLength(b)) return false;
if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
while (byteLength--) {
if (a.getUint8(byteLength) !== b.getUint8(byteLength)) {
return false;
Expand Down
5 changes: 2 additions & 3 deletions underscore-esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion underscore-esm.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions underscore.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion underscore.js.map

Large diffs are not rendered by default.

0 comments on commit 00d64f4

Please sign in to comment.