Skip to content

Commit 4f448f0

Browse files
committed
More inline hints
1 parent c431c1a commit 4f448f0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.md

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

77
## [Unreleased]
88

9+
### Added
10+
- Smaller internal API improvements
11+
- Smaller performance improvements
12+
913
## [1.4.0] - 2022-10-11
1014

1115
### Added

src/LinkDotNet.StringBuilder/ValueStringBuilder.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ public ValueStringBuilder(Span<char> initialBuffer)
6767
/// Creates a <see cref="string"/> instance from that builder.
6868
/// </summary>
6969
/// <returns>The <see cref="string"/> instance.</returns>
70+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7071
public override string ToString() => new(buffer[..bufferPosition]);
7172

7273
/// <summary>
7374
/// Returns the string as an <see cref="ReadOnlySpan{T}"/>.
7475
/// </summary>
7576
/// <returns>The filled array as <see cref="ReadOnlySpan{T}"/>.</returns>
77+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7678
public ReadOnlySpan<char> AsSpan() => buffer[..bufferPosition];
7779

7880
/// <summary>
@@ -89,10 +91,7 @@ public ValueStringBuilder(Span<char> initialBuffer)
8991
/// </code>
9092
/// </remarks>
9193
[MethodImpl(MethodImplOptions.AggressiveInlining)]
92-
public ref char GetPinnableReference()
93-
{
94-
return ref MemoryMarshal.GetReference(buffer);
95-
}
94+
public ref char GetPinnableReference() => ref MemoryMarshal.GetReference(buffer);
9695

9796
/// <summary>
9897
/// Tries to copy the represented string into the given <see cref="Span{T}"/>.

0 commit comments

Comments
 (0)