Skip to content

Commit ab65c88

Browse files
committed
🎨 MyExtensions: make class internal
Signed-off-by: Yves Bastide <[email protected]>
1 parent 75ad0e4 commit ab65c88

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

‎RobotsTxt/Extensions.cs‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
namespace RobotsTxt;
22

3-
public static class MyExtensions
3+
internal static class MyExtensions
44
{
5-
#if !NETCOREAPP
6-
public static bool Contains(this ReadOnlySpan<byte> self, byte other)
7-
{
8-
foreach (var c in self)
9-
{
10-
if (c == other)
11-
{
12-
return true;
13-
}
14-
}
15-
return false;
16-
}
17-
#endif
18-
195
public static bool EqualsIgnoreCase(this ReadOnlySpan<byte> self, ReadOnlySpan<byte> other)
206
{
217
if (self.Length != other.Length)
@@ -27,6 +13,7 @@ public static bool EqualsIgnoreCase(this ReadOnlySpan<byte> self, ReadOnlySpan<b
2713
{
2814
var c1 = self[i];
2915
var c2 = other[i];
16+
if (c1 == c2) continue;
3017
if ('A' <= c1 && c1 <= 'Z')
3118
c1 += 32;
3219
if ('A' <= c2 && c2 <= 'Z')
@@ -51,6 +38,7 @@ public static bool StartsWithIgnoreCase(this ReadOnlySpan<byte> span, ReadOnlySp
5138
{
5239
var c1 = span[i];
5340
var c2 = value[i];
41+
if (c1 == c2) continue;
5442
if ('A' <= c1 && c1 <= 'Z')
5543
c1 += 32;
5644
if ('A' <= c2 && c2 <= 'Z')

0 commit comments

Comments
 (0)