Merge null/pattern checks into complex pattern.

This commit is contained in:
2022-11-13 20:46:24 +00:00
parent c68760ec49
commit a8a74f385a
39 changed files with 75 additions and 133 deletions

View File

@@ -74,10 +74,10 @@ public sealed class ZZZNoFilter : IFilter
public bool HasResourceFork => false;
/// <inheritdoc />
public bool Identify(byte[] buffer) => buffer != null && buffer.Length > 0;
public bool Identify(byte[] buffer) => buffer is { Length: > 0 };
/// <inheritdoc />
public bool Identify(Stream stream) => stream != null && stream.Length > 0;
public bool Identify(Stream stream) => stream is { Length: > 0 };
/// <inheritdoc />
public bool Identify(string path) => File.Exists(path);