From 8717b1c67703dcfc82c3f6e624b38546d893ffa7 Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Fri, 29 Mar 2024 14:10:28 +0000 Subject: [PATCH] refactor(SiteFile): Remove redundant if statement remove if statement that returns the result of a boolean test. --- SiteFile/SiteFile.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/SiteFile/SiteFile.cs b/SiteFile/SiteFile.cs index 8271bbe..0142c57 100644 --- a/SiteFile/SiteFile.cs +++ b/SiteFile/SiteFile.cs @@ -72,13 +72,9 @@ public partial class SiteFile LoadMetadata(settings); } - // NOTE: By this point Metadata CANNOT be null as LoadMetadata would either have loaded the JSON or instantiated MetaData - if (Metadata!.GetValueOrDefault(info.FullName, DateTime.MinValue) == info.LastWriteTimeUtc) - { - return false; - } - - return true; + // NOTE: By this point Metadata CANNOT be null as LoadMetadata would either have loaded the JSON or instantiated blank MetaData + // The compiler however is unaware of this as it uses side effects, so we tell it there is no possible null value here. + return (Metadata!.GetValueOrDefault(info.FullName, DateTime.MinValue) == info.LastWriteTimeUtc); }