Add fast path for array comparison if objects are equal

This commit is contained in:
Quincy Morgan
2020-01-18 14:39:15 -05:00
parent 232375cfc0
commit c5b2ad1aca
+3 -1
View File
@@ -1,6 +1,9 @@
// Returns true if a and b have the same elements at the same indices.
export function utilArrayIdentical(a, b) {
// an array is always identical to itself
if (a === b) return true;
var i = a.length;
if (i !== b.length) return false;
while (i--) {
@@ -146,4 +149,3 @@ export function utilArrayUniqBy(a, key) {
return acc;
}, []);
}