Skip to content

Commit 79f9e7c

Browse files
committed
Simplified search
1 parent 67246e5 commit 79f9e7c

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/LinkDotNet.StringBuilder/NaiveSearch.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,9 @@ public static int FindFirst(ReadOnlySpan<char> text, ReadOnlySpan<char> word)
7272

7373
if (j == word.Length - 1)
7474
{
75-
index = i;
76-
break;
75+
return index;
7776
}
7877
}
79-
80-
if (index != -1)
81-
{
82-
break;
83-
}
8478
}
8579

8680
return index;
@@ -117,15 +111,9 @@ public static int FindLast(ReadOnlySpan<char> text, ReadOnlySpan<char> word)
117111

118112
if (j == word.Length - 1)
119113
{
120-
index = i;
121-
break;
114+
return index;
122115
}
123116
}
124-
125-
if (index != -1)
126-
{
127-
break;
128-
}
129117
}
130118

131119
return index;

src/LinkDotNet.StringBuilder/ValueStringBuilder.Append.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace LinkDotNet.StringBuilder;
44

5-
[SkipLocalsInit]
65
public ref partial struct ValueStringBuilder
76
{
87
/// <summary>

0 commit comments

Comments
 (0)