Ejemplo n.º 1
0
        public System.ValueType CloneFromCache(object array)
        {
            var span = this;

            span.array = Reference.Box(array);
            return((System.ValueType)span);
        }
Ejemplo n.º 2
0
 public Span(T[] array)
 {
     this.array = Reference.Box(array);
     count      = (array != null) ? array.Length : 0;
     shift      = Shiftof() + 1;
     start      = 0;
 }
Ejemplo n.º 3
0
 public static System.ValueType Assign(ValueType source)
 {
     return(new Span <T>()
     {
         array = Reference.Box(new ValueType[1] {
             source
         }),
         count = 1,
         shift = Shiftof() + 1
     });
     // => new Span<T>((T[]) (object) (new ValueType[1] { source }));
 }
Ejemplo n.º 4
0
 public Span(T[] array, int start, int length)
 {
     this.array = Reference.Box(array);
     if (array == null)
     {
         if (start != 0 || length != 0)
         {
             throw new System.ArgumentOutOfRangeException();
         }
         count = 0;
     }
     else
     {
         if (start < 0 || length < 0 || (start + length > array.Length))
         {
             throw new System.ArgumentOutOfRangeException();
         }
         count = length - start;
     }
     this.shift = Shiftof() + 1;
     this.start = 0;
 }