lib/Redisent/RedisentCluster.php
private function nextNode($needle) {
		$haystack = $this->nodes;
		while (count($haystack) > 2) {
			$try = floor(count($haystack) / 2);
			if ($haystack[$try] == $needle) {
				return $needle;
			}
			if ($needle < $haystack[$try]) {
				$haystack = array_slice($haystack, 0, $try + 1);
			}
			if ($needle > $haystack[$try]) {
				$haystack = array_slice($haystack, $try + 1);
			}
		}
		return $haystack[count($haystack)-1];
	}
private function nextNode($needle) {
		$haystack = $this->nodes;
		while (count($haystack) > 2) {
			$try = floor(count($haystack) / 2);
			if ($haystack[$try] == $needle) {
				return $needle;
			}
			if ($needle < $haystack[$try]) {
				$haystack = array_slice($haystack, 0, $try + 1);
			}
			if ($needle > $haystack[$try]) {
				$haystack = array_slice($haystack, $try + 1);
			}
		}
		return $haystack[count($haystack)-1];
	}
private function nextNode ( $ needle ) { $ haystack = $ this -> nodes ; while ( count ( $ haystack ) > 2 ) { $ try = floor ( count ( $ haystack ) / 2 ) ; if ( $ haystack [ $ try ] == $ needle ) { return $ needle ; } if ( $ needle < $ haystack [ $ try ] ) { $ haystack = array_slice ( $ haystack , 0 , $ try + 1 ) ; } if ( $ needle > $ haystack [ $ try ] ) { $ haystack = array_slice ( $ haystack , $ try + 1 ) ; } } return $ haystack [ count ( $ haystack ) - 1 ] ; }
Routes to the proper server node
@param integer $needle The hash value of the Redis command
@return Redisent The Redisent object associated with the hash
Routes to the proper server node