physicalIndex method

int physicalIndex(
  1. int index
)

Returns the internal buffer index for a given logical index. This can be used to efficiently map external arrays if needed.

Implementation

int physicalIndex(int index) {
  if (index < 0 || index >= length) {
    throw RangeError.index(index, this);
  }
  return (_head + index) % _capacity;
}