예제 #1
0
        public BList <T> RemoveSection(int start, int count)
        {
            if ((uint)count > _count - (uint)start)
            {
                throw new ArgumentOutOfRangeException(count < 0 ? "count" : "start+count");
            }

            var newList = new BList <T>(this, CopySectionHelper(start, count));

            // bug fix: we must RemoveRange after creating the new list, because
            // the section is expected to have the same height as the original tree
            // during the constructor of the new list.
            RemoveRange(start, count);
            return(newList);
        }
예제 #2
0
 protected BList(BList <T> original, AListNode <T, T> section)
     : base(original, section)
 {
     _compareItems = original._compareItems;
 }
예제 #3
0
 /// <inheritdoc cref="Clone(bool)"/>
 /// <param name="items">A list of items to be cloned.</param>
 public BList(BList <T> items, bool keepListChangingHandlers)
     : base(items, keepListChangingHandlers)
 {
     _compareItems = items._compareItems;
 }