module Continuum
Constants
- POINTS_PER_SERVER
Public Class Methods
Source
# File lib/memcache.rb, line 1159 def self.binary_search(ary, value, &block) upper = ary.size - 1 lower = 0 idx = 0 while(lower <= upper) do idx = (lower + upper) / 2 comp = ary[idx].value <=> value if comp == 0 return idx elsif comp > 0 upper = idx - 1 else lower = idx + 1 end end return upper end
Find the closest index in Continuum
with value <= the given value