Skip to content

Commit 8068cdd

Browse files
committed
fix netstandard2.0 minus alignment calculation
1 parent afa4b18 commit 8068cdd

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

src/Utf8StringInterpolation/Shims.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#pragma warning disable CA2014 // Do not use stackalloc in loops
22

3-
4-
#pragma warning disable CA2014 // Do not use stackalloc in loops
5-
63
using System.Buffers.Text;
74
using System.Text;
85

src/Utf8StringInterpolation/Utf8StringInterpolation.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<LangVersion>11</LangVersion>
77
<Nullable>enable</Nullable>
8-
8+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<NoWarn>$(NoWarn);CS1591;CA2255</NoWarn>
1010
<PackageTags>string</PackageTags>
1111
<Description>Successor of ZString; UTF8 based zero allocation high-peformance String Interpolation and StringBuilder.</Description>
1212
</PropertyGroup>
1313

14-
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
15-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
16-
</PropertyGroup>
17-
1814
<ItemGroup>
1915
<PackageReference Include="PolySharp" Version="1.7.1" />
2016
</ItemGroup>

src/Utf8StringInterpolation/Utf8StringWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public void AppendFormatted(string value, int alignment = 0, string? format = nu
214214
#if NETSTANDARD2_0
215215
unsafe
216216
{
217-
fixed (byte* ptr = &destination[currentWritten])
217+
fixed (byte* ptr = &destination[0])
218218
{
219219
charCount = Encoding.UTF8.GetCharCount(ptr, bytesWritten);
220220
}

0 commit comments

Comments
 (0)