Ejemplo n.º 1
0
        protected int IndexOf(object key)
        {
            var uhash = Striped.Smear(key.GetHashCode());
            var hash  = Convert.ToInt32(uhash);

            return(hash & mask);
        }
Ejemplo n.º 2
0
 protected PowerOfTwoStriped(int stripes)
 {
     Preconditions.CheckArgument(stripes > 0, "Stripes must be positive");
     mask = stripes > Ints.MaxPowerOfTwo ? Striped.AllBitsSet : Striped.CeilToPowerOfTwo(stripes) - 1;
 }