mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 10:19:07 +00:00
Optimize file name comparison in detectors
This commit is contained in:
@@ -30,6 +30,7 @@ public sealed class HostsDetector : IFormatDetector
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) return false;
|
||||
|
||||
return "hosts".Equals(Path.GetFileName(path), StringComparison.OrdinalIgnoreCase);
|
||||
var fileName = Path.GetFileName(path).AsSpan();
|
||||
return "hosts".AsSpan().Equals(fileName, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user