equalsWithComparator static method

bool equalsWithComparator(
  1. List<Coordinate>? coord1,
  2. List<Coordinate>? coord2,
  3. Comparator coordinateComparator
)

Returns true if the two arrays are identical, both null, or pointwise equal, using a user-defined {@link Comparator} for {@link Coordinate} s

@param coord1 an array of Coordinates @param coord2 an array of Coordinates @param coordinateComparator a Comparator for Coordinates

Implementation

static bool equalsWithComparator(List<Coordinate>? coord1,
    List<Coordinate>? coord2, Comparator coordinateComparator) {
  if (coord1 == coord2) return true;
  if (coord1 == null || coord2 == null) return false;
  if (coord1.length != coord2.length) return false;
  for (int i = 0; i < coord1.length; i++) {
    if (coordinateComparator(coord1[i], coord2[i]) != 0) return false;
  }
  return true;
}