Skip to content

Commit 4846b13

Browse files
Update src/Files.App/Helpers/NaturalStringComparer.cs
Co-authored-by: Lamparter <[email protected]> Signed-off-by: Neth Botheju <[email protected]>
1 parent bcec69e commit 4846b13

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Files.App/Helpers/NaturalStringComparer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ private static int GetExtensionPosition(ReadOnlySpan<char> text)
133133

134134
private static bool IsIgnorableSeparator(ReadOnlySpan<char> span, int index)
135135
{
136-
if (span[index] != '-' && span[index] != '_') return false;
136+
if (span[index] != '-' && span[index] != '_') return false;
137137

138-
// Check bounds before accessing span[index + 1] or span[index - 1]
139-
if (index == 0) return span.Length > 1 && char.IsLetterOrDigit(span[index + 1]);
140-
if (index == span.Length - 1) return span.Length > 1 && char.IsLetterOrDigit(span[index - 1]);
138+
// Check bounds before accessing span[index + 1] or span[index - 1]
139+
if (index == 0) return span.Length > 1 && char.IsLetterOrDigit(span[index + 1]);
140+
if (index == span.Length - 1) return span.Length > 1 && char.IsLetterOrDigit(span[index - 1]);
141141

142-
return char.IsLetterOrDigit(span[index - 1]) && char.IsLetterOrDigit(span[index + 1]);
142+
return char.IsLetterOrDigit(span[index - 1]) && char.IsLetterOrDigit(span[index + 1]);
143143
}
144144

145145

0 commit comments

Comments
 (0)