getIndex method

int getIndex(
  1. int x,
  2. int y
)

Implementation

int getIndex(int x, int y) {
  if (coordinatePlane == CacheCoordinatePlane.normal) {
    return ((y % height) * width) + (x % width);
  }

  return (_zigZag(y, height) * width) + _zigZag(x, width);
}