示例#1
0
        public void AddRange(FlexArray <T> src)
        {
            int cnt = Count + src.Count;

            if (cnt >= Data.Length)
            {
                Capacity = cnt * 3 / 2;
                Array.Resize <T>(ref Data, Capacity);
            }

            Array.Copy(src.Data, 0, Data, Count, src.Count);

            Count += src.Count;
        }
示例#2
0
        public void InsertRange(int idx, FlexArray <T> src)
        {
            int cnt = Count + src.Count;

            if (cnt >= Data.Length)
            {
                Capacity = cnt * 3 / 2;
                Array.Resize <T>(ref Data, Capacity);
            }

            Array.Copy(Data, idx, Data, idx + src.Count, Count - idx);
            Array.Copy(src.Data, 0, Data, idx, src.Count);

            Count += src.Count;
        }
示例#3
0
 public FlexArray(FlexArray <T> src)
 {
     Init(src.Count);
     Array.Copy(src.Data, Data, src.Count);
     Count = src.Count;
 }