sumLanePartial method

int sumLanePartial(
  1. int size
)

Sum part of the lane, until size.

Implementation

int sumLanePartial(int size) {
  switch (size) {
    case 1:
      return x;
    case 2:
      return x + y;
    case 3:
      return x + y + z;
    case 4:
      return x + y + z + w;
    default:
      throw StateError('Invalid length: $size / 4');
  }
}