Predis\Cluster\Distributor\HashRing::wrapAroundStrategy PHP Метод

wrapAroundStrategy() защищенный Метод

Implements a strategy to deal with wrap-around errors during binary searches.
protected wrapAroundStrategy ( integer $upper, integer $lower, integer $ringKeysCount ) : integer
$upper integer
$lower integer
$ringKeysCount integer
Результат integer
    protected function wrapAroundStrategy($upper, $lower, $ringKeysCount)
    {
        // Binary search for the last item in ringkeys with a value less or
        // equal to the key. If no such item exists, return the last item.
        return $upper >= 0 ? $upper : $ringKeysCount - 1;
    }