Use StringComparison.Ordinal instead of culture-sensitive comparisons

This commit is contained in:
Gérald Barré 2023-02-20 20:23:06 -05:00
parent 04610cf492
commit baa8220a52
No known key found for this signature in database

View File

@ -52,12 +52,12 @@ public sealed class TextPath : IRenderable, IHasJustification
_parts = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); _parts = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
// Rooted Unix path? // Rooted Unix path?
if (path.StartsWith("/")) if (path.StartsWith("/", StringComparison.Ordinal))
{ {
_rooted = true; _rooted = true;
_parts = new[] { "/" }.Concat(_parts).ToArray(); _parts = new[] { "/" }.Concat(_parts).ToArray();
} }
else if (_parts.Length > 0 && _parts[0].EndsWith(":")) else if (_parts.Length > 0 && _parts[0].EndsWith(":", StringComparison.Ordinal))
{ {
// Rooted Windows path // Rooted Windows path
_rooted = true; _rooted = true;