示例#1
0
    public void LinqNativeSequence()
    {
        var second = new NativeArray <int>(source, Allocator.Persistent);

        MeasureLinq(() => Linq.ToList(Linq.Concat(source, second))).Run();
        second.Dispose();
    }
示例#2
0
 public IEnumerator <T> GetEnumerator()
 {
     if (notifyEnumerable != null)
     {
         return(notifyEnumerable.GetEnumerator());
     }
     return(SL.Concat(Source, Other).GetEnumerator());
 }
示例#3
0
        /// <summary>
        /// Prepends a single value to a sequence.
        /// </summary>
        public static IEnumerable <TSource> Prepend <TSource>(this IEnumerable <TSource> source, TSource value)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            return(LinqEnumerable.Concat(LinqEnumerable.Repeat(value, 1), source));
        }
示例#4
0
        /// <summary>
        /// Returns a sequence consisting of the head elements and the given tail element.
        /// </summary>
        public static IEnumerable <T> Concat <T>(this IEnumerable <T> head, T tail)
        {
            if (head == null)
            {
                throw new ArgumentNullException("head");
            }

            return(LinqEnumerable.Concat(head, LinqEnumerable.Repeat(tail, 1)));
        }
示例#5
0
    public void BlinqShouldEqualLinqNativeArrayAppendArray([ArrayValues] int[] sourceArr, [ArrayValues] int[] secondArr)
    {
        var source   = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var second   = new NativeArray <int>(secondArr, Allocator.Persistent);
        var expected = ExceptionAndValue(() => Linq.ToArray(Linq.Concat(source, second)));
        var actual   = ExceptionAndValue(() => Linq.ToArray(Blinq.Concat(source, second)));

        AssertAreEqual(expected, actual);
        source.Dispose();
        second.Dispose();
    }
示例#6
0
 public static IEnumerable <TSource> Concat <TSource>(this IEnumerable <TSource> first, IEnumerable <TSource> second) =>
 LinqEnumerable.Concat(first, second);
示例#7
0
 public IEnumerator <T> GetEnumerator()
 {
     return(SL.Concat(Source, Other).GetEnumerator());
 }