示例#1
0
 public LstInternal <A> InsertRange(int index, IEnumerable <A> items, Pred <A> pred)
 {
     if (items == null)
     {
         return(this);
     }
     if (index < 0 || index > Root.Count)
     {
         throw new IndexOutOfRangeException();
     }
     return(Wrap(ListModuleM.InsertMany(Root, items, index, pred)));
 }
示例#2
0
 public LstInternal <A> AddRange(IEnumerable <A> items)
 {
     if (items == null)
     {
         return(this);
     }
     if (Count == 0)
     {
         return(new LstInternal <A>(items));
     }
     return(Wrap(ListModuleM.InsertMany(Root, items, Count)));
 }
示例#3
0
 internal LstInternal(IEnumerable <A> items)
 {
     hashCode = 0;
     root     = ListItem <A> .Empty;
     if (items is Lst <A> )
     {
         var lst = (Lst <A>)items;
         root = lst.Value.Root;
     }
     else
     {
         root = ListModuleM.InsertMany(root, items, 0);
     }
 }