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; }
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; }
public FlexArray(FlexArray <T> src) { Init(src.Count); Array.Copy(src.Data, Data, src.Count); Count = src.Count; }