From 7883638f0ae6e7d4af8aa6b53c623c1c53a546a7 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 1 May 2022 14:28:28 -0700 Subject: [PATCH] Make helper method easier to read --- BurnOutSharp/FileType/Executable.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index 89c1e3bc..9b63834d 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -189,13 +189,15 @@ namespace BurnOutSharp.FileType /// The protection result to be checked private bool ShouldAddProtection(object checkClass, bool scanPackers, string protection) { + // If we have an invalid protection + if (string.IsNullOrWhiteSpace(protection)) + return false; + // If we have a valid content check based on settings if (scanPackers || !checkClass.GetType().Namespace.ToLowerInvariant().Contains("packertype")) - { - if (!string.IsNullOrWhiteSpace(protection)) - return true; - } + return true; + // Everything else fails return false; }