Skip to content

Commit

Permalink
Added support for Span<T>/ReadOnlySpan<T> in net40 (#68)
Browse files Browse the repository at this point in the history
* t4-transform.targets: Set TransformOutOfDateOnly to true so we don't continually build without changes

* Directory.Build.props: Remove source revision info from InformationalVersion, since we already include it.

* ICU4N.TestFramework: Added net7.0 target to avoid implicit downgrades

* ICU4N.Tests: For now, disable the tests that depend on IKVM because it started causing errors with the compile

* SWEEP: Added FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING to methods that define this attribute, since this option doesn't exist in net40

* ValueStringBuilderTest: Remove pointer match test for net40, since StringBuilder doesn't have this overload.

* SWEEP: Updated dependencies to add Span<T>/ReadOnlySpan<T> support on net40

* .build/dependencies.props: Upgraded J2N to 2.1.0-alpha-0090

* .build/dependencies.props: Upgraded NetFx.System.Memory to 4.0.0
  • Loading branch information
NightOwl888 authored Apr 14, 2024
1 parent 37df14c commit c67c761
Show file tree
Hide file tree
Showing 17 changed files with 112 additions and 8 deletions.
26 changes: 26 additions & 0 deletions .build/TestReferences.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,30 @@
<PackageReference Include="NUnit" Version="$(NUnitPackageReferenceVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnit3TestAdapterPackageReferenceVersion)" />
</ItemGroup>

<!-- See the following post to understand this approach: https://duanenewman.net/blog/post/a-better-way-to-override-references-with-packagereference/ -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<!-- On net452, we incorrectly get references to System.Memory. We can exclude the DLL and dependencies as follows. The IDE view is wrong, these references don't actually exist.
ExcludeAssets=compile removes the dependency from being referenced. ExcludeAssets=runtime removes the dependency from the build output. -->

<PackageReference Include="J2N"
Version="$(J2NPackageReferenceVersion)"
ExcludeAssets="compile;runtime"
GeneratePathProperty="true" />
<PackageReference Include="System.Buffers"
Version="$(SystemBuffersPackageReferenceVersion)"
ExcludeAssets="compile;runtime" />
<PackageReference Include="System.Memory"
Version="$(SystemMemoryPackageReferenceVersion)"
ExcludeAssets="compile;runtime" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe"
Version="$(SystemRuntimeCompilerServicesUnsafePackageReferenceVersion)"
ExcludeAssets="compile;runtime" />
<PackageReference Include="NetFx.System.Memory"
Version="$(NetFxSystemMemoryPackageReferenceVersion)" />

<Reference Include="J2N">
<HintPath>$(PkgJ2N)/lib/net40/J2N.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
6 changes: 5 additions & 1 deletion .build/dependencies.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup Label="NuGet Package Reference Versions">
<IKVMMavenSdkPackageReferenceVersion>1.2.0</IKVMMavenSdkPackageReferenceVersion>
<J2NPackageReferenceVersion>2.1.0-alpha-0043</J2NPackageReferenceVersion>
<J2NPackageReferenceVersion>2.1.0-alpha-0090</J2NPackageReferenceVersion>
<MicrosoftExtensionsCachingMemoryPackageReferenceVersion>2.0.0</MicrosoftExtensionsCachingMemoryPackageReferenceVersion>
<MicrosoftExtensionsCachingMemoryPackageReferenceVersion Condition=" $(TargetFramework.StartsWith('net6.')) Or $(TargetFramework.StartsWith('net7.')) ">6.0.0</MicrosoftExtensionsCachingMemoryPackageReferenceVersion>
<MicrosoftExtensionsCachingMemoryPackageReferenceVersion Condition=" '$(TargetFramework)' == 'net451' ">1.1.2</MicrosoftExtensionsCachingMemoryPackageReferenceVersion>
Expand All @@ -10,10 +10,14 @@
<MicrosoftSourceLinkAzureReposGitPackageReferenceVersion>1.1.1</MicrosoftSourceLinkAzureReposGitPackageReferenceVersion>
<MicrosoftSourceLinkGitHubPackageReferenceVersion>$(MicrosoftSourceLinkAzureReposGitPackageReferenceVersion)</MicrosoftSourceLinkGitHubPackageReferenceVersion>
<NerdBankGitVersioningPackageReferenceVersion>[3.5.73-alpha]</NerdBankGitVersioningPackageReferenceVersion>
<NetFxSystemMemoryPackageReferenceVersion>4.0.0</NetFxSystemMemoryPackageReferenceVersion>
<NETStandardLibrary20PackageReferenceVersion>2.0.3</NETStandardLibrary20PackageReferenceVersion>
<NUnitPackageReferenceVersion>3.12.0</NUnitPackageReferenceVersion>
<NUnit3TestAdapterPackageReferenceVersion>3.13.0</NUnit3TestAdapterPackageReferenceVersion>
<SystemBuffersPackageReferenceVersion>4.5.1</SystemBuffersPackageReferenceVersion>
<SystemMemoryPackageReferenceVersion>4.5.5</SystemMemoryPackageReferenceVersion>
<SystemRuntimeCompilerServicesUnsafePackageReferenceVersion>6.0.0</SystemRuntimeCompilerServicesUnsafePackageReferenceVersion>
<SystemRuntimeCompilerServicesUnsafePackageReferenceVersion Condition=" '$(TargetFramework)' == 'net451' ">4.7.1</SystemRuntimeCompilerServicesUnsafePackageReferenceVersion>
</PropertyGroup>
<PropertyGroup Label=".NET Tool Package Versions">
<DotNetT4PackageVersion>3.0.0-preview-0027-g2711105671</DotNetT4PackageVersion>
Expand Down
2 changes: 1 addition & 1 deletion .build/t4-transform.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<TransformOnBuild>false</TransformOnBuild>
<OverwriteReadOnlyOutputFiles>true</OverwriteReadOnlyOutputFiles>
<TransformOutOfDateOnly>false</TransformOutOfDateOnly>
<TransformOutOfDateOnly>true</TransformOutOfDateOnly>
<TransformTargetsFilePath>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets</TransformTargetsFilePath>
</PropertyGroup>

Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<ArtifactsDir>$(RepositoryRoot)_artifacts</ArtifactsDir>
<CLSCompliant>true</CLSCompliant>
</PropertyGroup>

<PropertyGroup Label="Version Settings">
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

<PropertyGroup Label="Assembly Signing">
<AssemblyOriginatorKeyFile>$(RepositoryRoot).build/key.snk</AssemblyOriginatorKeyFile>
Expand All @@ -29,6 +33,8 @@
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<ICUDataEndian Label="b for big endian, l for little endian">b</ICUDataEndian>
<ICUDataPrefix>icudt</ICUDataPrefix>
<!-- This appears to be a bug in MSBuild. We need to use NUGET_PACKAGES if it is defined. -->
<NuGetPackageRoot Condition=" '$(NUGET_PACKAGES)' != '' ">$(NUGET_PACKAGES)</NuGetPackageRoot>
</PropertyGroup>

<PropertyGroup Label="Copyright Info">
Expand Down
18 changes: 15 additions & 3 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<DefineConstants>$(DefineConstants);FEATURE_ASYNCLOCAL</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_CULTUREINFO_CURRENTCULTURE_SETTER</DefineConstants>
<DefineConstants Condition=" '$(TargetFramework)' != 'netstandard1.0' ">$(DefineConstants);FEATURE_RUNTIMEINFORMATION_ISOSPLATFORM</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_STRINGBUILDER_APPEND_CHARPTR</DefineConstants>

<DebugType>portable</DebugType>
</PropertyGroup>
Expand All @@ -56,18 +57,23 @@

</PropertyGroup>

<!-- Features in .NET Framework 4.6+ only -->
<PropertyGroup Condition="$(TargetFramework.StartsWith('net46')) Or $(TargetFramework.StartsWith('net47')) Or $(TargetFramework.StartsWith('net48'))">

<DefineConstants>$(DefineConstants);FEATURE_STRINGBUILDER_APPEND_CHARPTR</DefineConstants>

</PropertyGroup>

<!-- Features in .NET Framework 4.5+, .NET Standard 2.x, .NET Core 2.x, .NET Core 3.x, .NET 5.x, .NET 6.x, and .NET 7.x -->
<!-- These features are not in .NET Framework 4.0 or .NET Framework 4.5.2 (the target framework we use for testing .NET Framework 4.0) -->
<PropertyGroup Condition=" ('$(TargetFramework)' != 'net40' And '$(TargetFramework)' != 'net452' And $(TargetFramework.StartsWith('net4'))) Or $(TargetFramework.StartsWith('netstandard2.')) Or $(TargetFramework.StartsWith('netcoreapp2.')) Or $(TargetFramework.StartsWith('netcoreapp3.')) Or $(TargetFramework.StartsWith('net5.')) Or $(TargetFramework.StartsWith('net6.')) Or $(TargetFramework.StartsWith('net7.')) ">

<DefineConstants>$(DefineConstants);FEATURE_ARRAYPOOL</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_CULTUREINFO_DEFAULTTHREADCURRENTCULTURE</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_EXCEPTION_HRESULT</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_IREADONLYCOLLECTIONS</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_MICROSOFT_EXTENSIONS_CACHING</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_REGEX_MATCHTIMEOUT</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_SPAN</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_TASK_ASYNC_AWAIT</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_TASK_RUN</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_TYPEDWEAKREFERENCE</DefineConstants>
Expand Down Expand Up @@ -141,6 +147,12 @@
<DebugType>full</DebugType>
</PropertyGroup>

<!-- Features defined everywhere (to be removed) -->
<PropertyGroup>
<DefineConstants>$(DefineConstants);FEATURE_ARRAYPOOL</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_SPAN</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
</PropertyGroup>
Expand Down Expand Up @@ -204,7 +216,7 @@

<!-- Global PackageReferences -->

<ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
<!-- This is to allow the .NET Framework references to be machine-indepenedent so builds can happen without installing prerequisites -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="$(MicrosoftNETFrameworkReferenceAssembliesPackageReferenceVersion)" PrivateAssets="All" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ICU4N.TestFramework/Dev/Util/UnicodeMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ public static IDictionary<T, UnicodeSet> Freeze(IDictionary<T, UnicodeSet> targe
{
entry.Freeze();
}
return target.AsReadOnly();
return new J2N.Collections.ObjectModel.ReadOnlyDictionary<T, UnicodeSet>(target);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ICU4N.TestFramework/ICU4N.TestFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework></TargetFramework>
<TargetFrameworks>net6.0;netstandard2.0;net451;net40</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;netstandard2.0;net451;net40</TargetFrameworks>
<RootNamespace>ICU4N</RootNamespace>
<CLSCompliant>false</CLSCompliant>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/ICU4N/Impl/LocaleIDParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,15 @@ public LocaleIDParser(string localeID, bool canonicalize)
#if FEATURE_SPAN

#if !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void Reset(string localeID)
=> Reset(localeID.AsSpan());

#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public void Reset(string localeID, bool canonicalize)
=> Reset(localeID.AsSpan(), canonicalize);
#endif
Expand Down Expand Up @@ -198,7 +202,9 @@ private ReadOnlySpan<char> AsSpan(int start)
#if FEATURE_SPAN

#if !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
private void Set(int pos, string s)
=> Set(pos, s.AsSpan());
#endif
Expand Down
12 changes: 12 additions & 0 deletions src/ICU4N/Impl/LocaleIDs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public static string[] GetISOLanguages()
/// <exception cref="System.Resources.MissingManifestResourceException">Throws <see cref="System.Resources.MissingManifestResourceException"/> if the
/// three-letter country abbreviation is not available for this locale.</exception>
/// <stable>ICU 3.0</stable>
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string GetThreeLetterISOCountryName(string country)
=> GetThreeLetterISOCountryName(country.AsSpan());
#endif
Expand Down Expand Up @@ -95,7 +97,9 @@ string country
/// <exception cref="System.Resources.MissingManifestResourceException">Throws <see cref="System.Resources.MissingManifestResourceException"/> if the
/// three-letter language abbreviation is not available for this locale.</exception>
/// <stable>ICU 3.0</stable>
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string GetThreeLetterISOLanguageName(string language)
=> GetThreeLetterISOLanguageName(language.AsSpan());
#endif
Expand Down Expand Up @@ -136,7 +140,9 @@ string language
}

#if FEATURE_SPAN && !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string ThreeToTwoLetterLanguage(string lang)
=> ThreeToTwoLetterLanguage(lang.AsSpan());
#endif
Expand Down Expand Up @@ -166,7 +172,9 @@ string lang
}

#if FEATURE_SPAN && !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string ThreeToTwoLetterRegion(string region)
=> ThreeToTwoLetterRegion(region.AsSpan());
#endif
Expand Down Expand Up @@ -541,7 +549,9 @@ updated to include 1999/12/03 revisions *CWB*/
};

#if FEATURE_SPAN && !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string GetCurrentCountryID(string oldID)
=> GetCurrentCountryID(oldID.AsSpan());
#endif
Expand All @@ -563,7 +573,9 @@ string oldID
}

#if FEATURE_SPAN && !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string GetCurrentLanguageID(string oldID)
=> GetCurrentLanguageID(oldID.AsSpan());
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/ICU4N/Impl/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,9 @@ public static string Escape(string s)
/// be updated to point after the escape sequence.</param>
/// <returns>Character value from 0 to 10FFFF, or -1 on error.</returns>
// ICU4N: To fix lack of implicit conversion
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static int UnescapeAt(string s, ref int offset16)
=> UnescapeAt(s.AsSpan(), ref offset16);
#endif
Expand Down Expand Up @@ -1074,7 +1076,9 @@ public static int UnescapeAt(char[] s, ref int offset16) // ICU4N: Changed array
/// </summary>
/// <exception cref="ArgumentException">If an invalid escape is seen.</exception>
// ICU4N: To fix lack of implicit conversion
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string Unescape(string s)
=> Unescape(s.AsSpan());
#endif
Expand Down Expand Up @@ -1130,7 +1134,9 @@ public static string Unescape(string s)
/// Convert all escapes in a given string using <see cref="UnescapeAt(ReadOnlySpan{char}, ref int)"/>.
/// Leave invalid escape sequences unchanged.
/// </summary>
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static string UnescapeLeniently(string s)
=> UnescapeLeniently(s.AsSpan());
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/ICU4N/Support/MemoryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public static bool StartsWith(this ReadOnlySpan<char> span, string value, String
/// <summary>
/// Determines whether the specified sequence appears at the start of the span.
/// </summary>
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public unsafe static bool StartsWith<T>(this ReadOnlySpan<T> span, string value) where T : IEquatable<T>
{
int valueLength = value.Length;
Expand Down Expand Up @@ -170,7 +172,9 @@ public static bool EndsWith(this ReadOnlySpan<char> span, string value, StringCo
/// <summary>
/// Determines whether the specified sequence appears at the end of the span.
/// </summary>
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public unsafe static bool EndsWith<T>(this ReadOnlySpan<T> span, string value) where T : IEquatable<T>
{
int spanLength = span.Length;
Expand Down Expand Up @@ -260,7 +264,9 @@ public static bool Equals(this ReadOnlySpan<char> span, ReadOnlySpan<char> other
}
}

#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
internal static bool EqualsOrdinal(this ReadOnlySpan<char> span, ReadOnlySpan<char> value)
{
if (span.Length != value.Length)
Expand Down
4 changes: 4 additions & 0 deletions src/ICU4N/Support/Text/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public static int CompareToOrdinalIgnoreCase(this string str, string value)
/// <param name="s">This string.</param>
/// <param name="destination">The span into which to copy this string's contents.</param>
/// <exception cref="ArgumentException">If <paramref name="destination"/> is too short.</exception>
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static void CopyTo(this string s, Span<char> destination) // ICU4N TODO: Move to J2N?
{
if (s is null)
Expand All @@ -35,7 +37,9 @@ public static void CopyTo(this string s, Span<char> destination) // ICU4N TODO:
/// <param name="s">This string.</param>
/// <param name="destination">The span into which to copy this string's contents.</param>
/// <returns>true if the data was copied; false if the destination was too short to fit the contents of the string.</returns>
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static bool TryCopyTo(this string s, Span<char> destination) // ICU4N TODO: Move to J2N?
{
if (s is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ internal ref partial struct ValueStringBuilder
private const int CharStackBufferSize = 32;

#if !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
internal void AppendFormat(long value, string? format, UNumberFormatInfo info, int[]? numberGroupSizesOverride = null)
=> AppendFormat(value, format.AsSpan(), info, numberGroupSizesOverride);
#endif
Expand Down Expand Up @@ -47,7 +49,9 @@ internal void AppendFormat(long value, ReadOnlySpan<char> format, UNumberFormatI


#if !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
internal void AppendFormat(double value, string? format, UNumberFormatInfo info, int[]? numberGroupSizesOverride = null)
=> AppendFormat(value, format.AsSpan(), info, numberGroupSizesOverride);
#endif
Expand Down Expand Up @@ -80,7 +84,9 @@ internal void AppendFormat(double value, ReadOnlySpan<char> format, UNumberForma
}

#if !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
internal void InsertFormat(int index, long value, string? format, UNumberFormatInfo info, int[]? numberGroupSizesOverride = null)
=> InsertFormat(index, value, format.AsSpan(), info, numberGroupSizesOverride);
#endif
Expand Down Expand Up @@ -108,7 +114,9 @@ internal void InsertFormat(int index, long value, ReadOnlySpan<char> format, UNu
}

#if !FEATURE_STRING_IMPLCIT_TO_READONLYSPAN
#if FEATURE_METHODIMPLOPTIONS_AGRESSIVEINLINING
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
internal void InsertFormat(int index, double value, string? format, UNumberFormatInfo info, int[]? numberGroupSizesOverride = null)
=> InsertFormat(index, value, format.AsSpan(), info, numberGroupSizesOverride);
#endif
Expand Down
Loading

0 comments on commit c67c761

Please sign in to comment.