예제 #1
0
        public void NoGarbageCreateAndGetShouldWork()
        {
            int[] arr  = { 1, 2, 3 };
            var   iArr = ImmutableArrayUnsafe.createByMove(arr);

            iArr.shouldEqual(
                ImmutableArray.Create(arr),
                "it should be the same as created via a safe way"
                );
            var arr2 = iArr.internalArray();

            arr2.shouldRefEqual(arr, "it should be the same reference");
        }
예제 #2
0
 public static A[] internalArray <A>(this ImmutableArray <A> arr) =>
 ImmutableArrayUnsafe <A> .internalArray(arr);
예제 #3
0
 public static ImmutableArray <A> createByMove <A>(A[] arr) =>
 ImmutableArrayUnsafe <A> .constructor(new object[] { arr });