indexWhereFloatCount function

int indexWhereFloatCount(
  1. List<int> floatCounts,
  2. bool test(
    1. int floats
    )
)

Index of the first entry in floatCounts for which test returns true, or -1 if none match.

Implementation

int indexWhereFloatCount(
  List<int> floatCounts,
  bool Function(int floats) test,
) {
  for (int i = 0; i < floatCounts.length; i++) {
    if (test(floatCounts[i])) return i;
  }
  return -1;
}