distance method

int distance(
  1. int from,
  2. int to
)

Returns forward distance from from to to in the ring.

Implementation

int distance(int from, int to) => _normalize(to - from, capacity);