using System.Runtime.CompilerServices; namespace System { internal static class ArrayExt { private static class EmptyArray { public static readonly T[] Value; static EmptyArray() { Value = new T[0]; } } #if NETSTANDARD [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T[] Empty() => Array.Empty(); #else [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T[] Empty() => EmptyArray.Value; #endif } }