equalsEach static method
Tests if a list equals another by comparing one-by-one *
-
equal
- the closure to compare elements in the given lists.
- If omitted, it compares each item in the list with
identical()
.
Implementation
static bool equalsEach(List al, bl, [bool equal(a, b)?]) {
if (identical(al, bl))
return true;
if (!(bl is List))
return false;
final bl2 = bl,
length = al.length;
if (length != bl2.length)
return false;
if (equal == null)
equal = identical;
for (int i = 0; i < length; i++) {
if (!equal(al[i], bl2[i]))
return false;
}
return true;
}