Remove unused HashRing::newWithoutLocation() method
[lhc/web/wiklou.git] / includes / libs / HashRing.php
index f61c139..3b9c24d 100644 (file)
  * @since 1.22
  */
 class HashRing {
-       /** @var Array (location => weight) */
+       /** @var array (location => weight) */
        protected $sourceMap = [];
-       /** @var Array (location => (start, end)) */
+       /** @var array (location => (start, end)) */
        protected $ring = [];
 
        /** @var HashRing|null */
        protected $liveRing;
-       /** @var Array (location => UNIX timestamp) */
+       /** @var array (location => UNIX timestamp) */
        protected $ejectionExpiries = [];
        /** @var int UNIX timestamp */
        protected $ejectionNextExpiry = INF;
@@ -83,7 +83,7 @@ class HashRing {
         * @param string $item
         * @return string Location
         */
-       public function getLocation( $item ) {
+       final public function getLocation( $item ) {
                $locations = $this->getLocations( $item, 1 );
 
                return $locations[0];
@@ -136,19 +136,6 @@ class HashRing {
                return $this->sourceMap;
        }
 
-       /**
-        * Get a new hash ring with a location removed from the ring
-        *
-        * @param string $location
-        * @return HashRing|bool Returns false if no non-zero weighted spots are left
-        */
-       public function newWithoutLocation( $location ) {
-               $map = $this->sourceMap;
-               unset( $map[$location] );
-
-               return count( $map ) ? new self( $map ) : false;
-       }
-
        /**
         * Remove a location from the "live" hash ring
         *
@@ -174,7 +161,7 @@ class HashRing {
         * @return HashRing
         * @throws UnexpectedValueException
         */
-       public function getLiveRing() {
+       protected function getLiveRing() {
                $now = time();
                if ( $this->liveRing === null || $this->ejectionNextExpiry <= $now ) {
                        $this->ejectionExpiries = array_filter(