protected int IndexOf(object key) { var uhash = Striped.Smear(key.GetHashCode()); var hash = Convert.ToInt32(uhash); return(hash & mask); }
protected PowerOfTwoStriped(int stripes) { Preconditions.CheckArgument(stripes > 0, "Stripes must be positive"); mask = stripes > Ints.MaxPowerOfTwo ? Striped.AllBitsSet : Striped.CeilToPowerOfTwo(stripes) - 1; }