Skip to content

Commit 3a817c4

Browse files
author
LinkDotNet Bot
committed
Updating to newest release
2 parents f34f781 + bea4a67 commit 3a817c4

File tree

11 files changed

+30
-15
lines changed

11 files changed

+30
-15
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v4.0.0
25+
uses: actions/checkout@v4.1.0
2626

2727
- uses: actions/[email protected]
2828
with:

.github/workflows/create-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121

2222
- name: Checkout repository
23-
uses: actions/checkout@v4.0.0
23+
uses: actions/checkout@v4.1.0
2424
with:
2525
token: ${{ secrets.SBPAT }}
2626
persist-credentials: true

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: windows-latest
1313

1414
steps:
15-
- uses: actions/checkout@v4.0.0
15+
- uses: actions/checkout@v4.1.0
1616

1717
- name: Setup .NET
1818
uses: actions/[email protected]

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v4.0.0
15+
- uses: actions/checkout@v4.1.0
1616
- name: Setup .NET
1717
uses: actions/[email protected]
1818
with:

.github/workflows/update-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4.0.0
16+
uses: actions/checkout@v4.1.0
1717
with:
1818
token: ${{ secrets.SBPAT }}
1919
persist-credentials: false
@@ -32,7 +32,7 @@ jobs:
3232
git merge --no-ff -X theirs origin/main -m "Updating to newest release"
3333
3434
- name: Push changes
35-
uses: ad-m/github-push-action@v0.6.0
35+
uses: ad-m/github-push-action@v0.8.0
3636
with:
3737
github_token: ${{ secrets.SBPAT }}
3838
branch: stable

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ All notable changes to **ValueStringBuilder** will be documented in this file. T
66

77
## [Unreleased]
88

9+
## [1.18.4] - 2023-10-14
10+
11+
### Changed
12+
13+
- Optimized `Append(scoped ReadOnlySpan<char>)` to be roughly 5% faster
14+
- Optimized `AppendLine` to have less overhead
15+
916
## [1.18.3] - 2023-09-22
1017

1118
### Changed
@@ -360,7 +367,9 @@ This release brings extensions to the `ValueStringBuilder` API. For `v1.0` the `
360367

361368
- Initial release
362369

363-
[Unreleased]: https://github.com/linkdotnet/StringBuilder/compare/1.18.3...HEAD
370+
[Unreleased]: https://github.com/linkdotnet/StringBuilder/compare/1.18.4...HEAD
371+
372+
[1.18.4]: https://github.com/linkdotnet/StringBuilder/compare/1.18.3...1.18.4
364373

365374
[1.18.3]: https://github.com/linkdotnet/StringBuilder/compare/1.18.2...1.18.3
366375

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
4-
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.10.0.77988">
4+
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
55
<PrivateAssets>all</PrivateAssets>
66
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
77
</PackageReference>

src/LinkDotNet.StringBuilder/LinkDotNet.StringBuilder.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</PropertyGroup>
4141

4242
<ItemGroup>
43-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.85">
43+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.93">
4444
<PrivateAssets>all</PrivateAssets>
4545
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4646
</PackageReference>

src/LinkDotNet.StringBuilder/ValueStringBuilder.Append.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Runtime.CompilerServices;
2+
using System.Runtime.InteropServices;
23

34
namespace LinkDotNet.StringBuilder;
45

@@ -51,7 +52,13 @@ public void Append(scoped ReadOnlySpan<char> str)
5152
Grow(newSize);
5253
}
5354

54-
str.CopyTo(buffer[bufferPosition..]);
55+
ref var strRef = ref MemoryMarshal.GetReference(str);
56+
ref var bufferRef = ref MemoryMarshal.GetReference(buffer[bufferPosition..]);
57+
Unsafe.CopyBlock(
58+
ref Unsafe.As<char, byte>(ref bufferRef),
59+
ref Unsafe.As<char, byte>(ref strRef),
60+
(uint)(str.Length * sizeof(char)));
61+
5562
bufferPosition += str.Length;
5663
}
5764

@@ -91,8 +98,7 @@ public void Append(ReadOnlyMemory<char> memory)
9198
[MethodImpl(MethodImplOptions.AggressiveInlining)]
9299
public void AppendLine(scoped ReadOnlySpan<char> str)
93100
{
94-
Append(str);
95-
Append(Environment.NewLine);
101+
Append(string.Concat(str, Environment.NewLine));
96102
}
97103

98104
[MethodImpl(MethodImplOptions.AggressiveInlining)]

tests/LinkDotNet.StringBuilder.Benchmarks/LinkDotNet.StringBuilder.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="BenchmarkDotNet" Version="0.13.8" />
12+
<PackageReference Include="BenchmarkDotNet" Version="0.13.9" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

0 commit comments

Comments
 (0)