Exemplo n.º 1
0
 public static void ResizeList <T>(List <T> list, int size)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     if (size < 0 || size > list.Capacity)
     {
         throw new ArgumentException("list", "invalid size to resize.");
     }
     if (size != list.Count)
     {
         NoAllocHelpers.Internal_ResizeList(list, size);
     }
 }
Exemplo n.º 2
0
        public static void ResizeList <T>(List <T> list, int size)
        {
            bool flag = list == null;

            if (flag)
            {
                throw new ArgumentNullException("list");
            }
            bool flag2 = size <0 || size> list.Capacity;

            if (flag2)
            {
                throw new ArgumentException("invalid size to resize.", "list");
            }
            bool flag3 = size != list.Count;

            if (flag3)
            {
                NoAllocHelpers.Internal_ResizeList(list, size);
            }
        }