diff --git a/src/ImageSharp/Formats/Bmp/BmpFormat.cs b/src/ImageSharp/Formats/Bmp/BmpFormat.cs
index c0ed5aaba..bf73d3162 100644
--- a/src/ImageSharp/Formats/Bmp/BmpFormat.cs
+++ b/src/ImageSharp/Formats/Bmp/BmpFormat.cs
@@ -33,14 +33,9 @@ namespace ImageSharp.Formats
///
public bool IsSupportedFileFormat(byte[] header)
{
- bool isBmp = false;
- if (header.Length >= this.HeaderSize)
- {
- isBmp = header[0] == 0x42 && // B
- header[1] == 0x4D; // M
- }
-
- return isBmp;
+ return header.Length >= this.HeaderSize &&
+ header[0] == 0x42 && // B
+ header[1] == 0x4D; // M
}
}
}
diff --git a/src/ImageSharp/Formats/Jpg/JpegFormat.cs b/src/ImageSharp/Formats/Jpg/JpegFormat.cs
index 6712de54b..b93c6ae69 100644
--- a/src/ImageSharp/Formats/Jpg/JpegFormat.cs
+++ b/src/ImageSharp/Formats/Jpg/JpegFormat.cs
@@ -33,20 +33,8 @@ namespace ImageSharp.Formats
///
public bool IsSupportedFileFormat(byte[] header)
{
- Guard.NotNull(header, "header");
-
- bool isSupported = false;
-
- if (header.Length >= this.HeaderSize)
- {
- bool isJfif = IsJfif(header);
- bool isExif = IsExif(header);
- bool isJpeg = IsJpeg(header);
-
- isSupported = isJfif || isExif || isJpeg;
- }
-
- return isSupported;
+ return header.Length >= this.HeaderSize &&
+ (IsJfif(header) || IsExif(header) || IsJpeg(header));
}
///