Skip to content

Commit

Permalink
fix netstandard2.0 minus alignment calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Dec 2, 2023
1 parent afa4b18 commit 8068cdd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/Utf8StringInterpolation/Shims.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#pragma warning disable CA2014 // Do not use stackalloc in loops


#pragma warning disable CA2014 // Do not use stackalloc in loops

using System.Buffers.Text;
using System.Text;

Expand Down
6 changes: 1 addition & 5 deletions src/Utf8StringInterpolation/Utf8StringInterpolation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>11</LangVersion>
<Nullable>enable</Nullable>

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>$(NoWarn);CS1591;CA2255</NoWarn>
<PackageTags>string</PackageTags>
<Description>Successor of ZString; UTF8 based zero allocation high-peformance String Interpolation and StringBuilder.</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PolySharp" Version="1.7.1" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Utf8StringInterpolation/Utf8StringWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void AppendFormatted(string value, int alignment = 0, string? format = nu
#if NETSTANDARD2_0
unsafe
{
fixed (byte* ptr = &destination[currentWritten])
fixed (byte* ptr = &destination[0])
{
charCount = Encoding.UTF8.GetCharCount(ptr, bytesWritten);
}
Expand Down

0 comments on commit 8068cdd

Please sign in to comment.