bitsToInt function

int bitsToInt(
  1. List<bool> bools
)

Implementation

int bitsToInt(List<bool> bools) {
  int result = 0;
  for (int i = 0; i < bools.length; i++) {
    result = (result << 1) | (bools[i] ? 1 : 0);
  }
  return result;
}