mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Add fast path for array comparison if objects are equal
This commit is contained in:
@@ -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;
|
||||
}, []);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user