Skip to content

Commit fa8db2b

Browse files
committed
Removed AggressiveOptimiztation
1 parent cf882eb commit fa8db2b

File tree

5 files changed

+2
-13
lines changed

5 files changed

+2
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ All notable changes to **ValueStringBuilder** will be documented in this file. T
77
## [Unreleased]
88

99
### Added
10-
- Enabled more optimizations.
10+
- Enabled some optimization hints for the compiler.
1111

1212
## [1.0.0] - 2022-04-12
1313

@@ -64,4 +64,4 @@ This release brings extensions to the `ValueStringBuilder` API. For `v1.0` the `
6464

6565
[1.0.0]: https://github.com/linkdotnet/StringBuilder/compare/0.9.5...1.0.0
6666

67-
[0.9.5]: https://github.com/linkdotnet/StringBuilder/compare/0.9.4...0.9.5
67+
[0.9.5]: https://github.com/linkdotnet/StringBuilder/compare/0.9.4...0.9.5

src/LinkDotNet.StringBuilder/TypedSpanList.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public TypedSpanList()
2424

2525
public ReadOnlySpan<T> AsSpan => buffer[..count];
2626

27-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
2827
public void Add(T value)
2928
{
3029
if (count >= buffer.Length)

src/LinkDotNet.StringBuilder/ValueStringBuilder.Append.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public ref partial struct ValueStringBuilder
6969
/// Appends a string to the string builder.
7070
/// </summary>
7171
/// <param name="str">String, which will be added to this builder.</param>
72-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
7372
public void Append(ReadOnlySpan<char> str)
7473
{
7574
var newSize = str.Length + bufferPosition;
@@ -102,7 +101,6 @@ public void AppendLine(ReadOnlySpan<char> str)
102101
Append(Environment.NewLine);
103102
}
104103

105-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
106104
private void AppendSpanFormattable<T>(T value)
107105
where T : ISpanFormattable
108106
{

src/LinkDotNet.StringBuilder/ValueStringBuilder.AppendJoin.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public void AppendJoin<T>(ReadOnlySpan<char> separator, IEnumerable<T> values)
4242
public void AppendJoin<T>(char separator, IEnumerable<T> values)
4343
=> AppendJoinInternalChar(separator, values);
4444

45-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
4645
private void AppendJoinInternalString<T2>(ReadOnlySpan<char> separator, IEnumerable<T2> values)
4746
{
4847
ArgumentNullException.ThrowIfNull(values);
@@ -71,7 +70,6 @@ private void AppendJoinInternalString<T2>(ReadOnlySpan<char> separator, IEnumera
7170
}
7271
}
7372

74-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
7573
private void AppendJoinInternalChar<T2>(char separator, IEnumerable<T2> values)
7674
{
7775
ArgumentNullException.ThrowIfNull(values);
@@ -100,7 +98,6 @@ private void AppendJoinInternalChar<T2>(char separator, IEnumerable<T2> values)
10098
}
10199
}
102100

103-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
104101
private void AppendInternal<T>(T value)
105102
{
106103
if (value is ISpanFormattable spanFormattable)

src/LinkDotNet.StringBuilder/ValueStringBuilder.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ public void Clear()
103103
/// <remarks>
104104
/// If <paramref name="newCapacity"/> is smaller or equal to <see cref="Length"/> nothing will be done.
105105
/// </remarks>
106-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
107106
public void EnsureCapacity(int newCapacity)
108107
{
109108
if (newCapacity < 0)
@@ -125,7 +124,6 @@ public void EnsureCapacity(int newCapacity)
125124
/// <remarks>
126125
/// This method will not affect the internal size of the string.
127126
/// </remarks>
128-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
129127
public void Remove(int startIndex, int length)
130128
{
131129
if (length == 0)
@@ -167,7 +165,6 @@ public void Remove(int startIndex, int length)
167165
/// <param name="word">Word to look for in this string.</param>
168166
/// <param name="startIndex">Index to begin with.</param>
169167
/// <returns>The index of the found <paramref name="word"/> in this string or -1 if not found.</returns>
170-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
171168
public int IndexOf(ReadOnlySpan<char> word, int startIndex)
172169
{
173170
if (startIndex < 0)
@@ -192,7 +189,6 @@ public int IndexOf(ReadOnlySpan<char> word, int startIndex)
192189
/// <param name="word">Word to look for in this string.</param>
193190
/// <param name="startIndex">Index to begin with.</param>
194191
/// <returns>The index of the found <paramref name="word"/> in this string or -1 if not found.</returns>
195-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
196192
public int LastIndexOf(ReadOnlySpan<char> word, int startIndex)
197193
{
198194
if (startIndex < 0)
@@ -203,7 +199,6 @@ public int LastIndexOf(ReadOnlySpan<char> word, int startIndex)
203199
return NaiveSearch.FindLast(buffer[startIndex..bufferPosition], word);
204200
}
205201

206-
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
207202
private void Grow(int capacity = 0)
208203
{
209204
var currentSize = buffer.Length;

0 commit comments

Comments
 (0)