Beispiel #1
0
        static void UpdateActionArray <T>(ActionSegment <T> sourceActionBuffer, ActionSegment <T> destination)
            where T : struct
        {
            if (sourceActionBuffer.Length <= 0)
            {
                destination.Clear();
            }
            else
            {
                Debug.Assert(sourceActionBuffer.Length == destination.Length,
                             $"sourceActionBuffer:{sourceActionBuffer.Length} is a different" +
                             $" size than destination: {destination.Length}.");

                Array.Copy(sourceActionBuffer.Array,
                           sourceActionBuffer.Offset,
                           destination.Array,
                           destination.Offset,
                           destination.Length);
            }
        }
        static void UpdateActionArray<T>(ActionSegment<T> sourceActionBuffer, ActionSegment<T> destination)
            where T : struct
        {
            if (sourceActionBuffer.Length <= 0)
            {
                destination.Clear();
            }
            else
            {
                if (sourceActionBuffer.Length != destination.Length)
                {
                    Debug.AssertFormat(sourceActionBuffer.Length == destination.Length,
                        "sourceActionBuffer: {0} is a different size than destination: {1}.",
                        sourceActionBuffer.Length,
                        destination.Length);
                }

                Array.Copy(sourceActionBuffer.Array,
                    sourceActionBuffer.Offset,
                    destination.Array,
                    destination.Offset,
                    destination.Length);
            }
        }