/// <summary> /// Removes an id. /// </summary> /// <param name="number"></param> private void NegativeRemove(long number) { if (number < LongIndexNode.CalculateBaseNumber((short)(_rootNegative.Base + 1))) { _rootNegative.Remove(number); } }
/// <summary> /// Returns true if the id is there. /// </summary> /// <param name="number"></param> /// <returns></returns> private bool NegativeContains(long number) { if (number < LongIndexNode.CalculateBaseNumber((short)(_rootNegative.Base + 1))) { return(_rootNegative.Contains(number)); } return(false); }
/// <summary> /// Adds an id. /// </summary> /// <param name="number"></param> private void PositiveAdd(long number) { while (number >= LongIndexNode.CalculateBaseNumber((short)(_rootPositive.Base + 1))) { LongIndexNode oldRoot = _rootPositive; _rootPositive = new LongIndexNode((short)(_rootPositive.Base + 1)); _rootPositive.Has0 = oldRoot; } _rootPositive.Add(number); }