diff --git a/starsky/starsky.feature.health/HealthCheck/DiskStorageHealthCheck.cs b/starsky/starsky.feature.health/HealthCheck/DiskStorageHealthCheck.cs index 7826d8bb8d..bb2dba5e4b 100644 --- a/starsky/starsky.feature.health/HealthCheck/DiskStorageHealthCheck.cs +++ b/starsky/starsky.feature.health/HealthCheck/DiskStorageHealthCheck.cs @@ -59,8 +59,9 @@ private static (bool Exists, long ActualFreeMegabytes) GetSystemDriveInfo(string return ( false, 0L ); } - var driveInfo = drivesList.FirstOrDefault( - drive => string.Equals(drive.Name, driveName, StringComparison.InvariantCultureIgnoreCase)); + var driveInfo = Array.Find(drivesList, + drive => string.Equals(drive.Name, driveName, + StringComparison.InvariantCultureIgnoreCase)); return driveInfo?.AvailableFreeSpace != null ? (true, driveInfo.AvailableFreeSpace / 1024L / 1024L) : (false, 0L); } } diff --git a/starsky/starsky.feature.health/HealthCheck/PathExistHealthCheck.cs b/starsky/starsky.feature.health/HealthCheck/PathExistHealthCheck.cs index 704ef39231..7ee4d4d437 100644 --- a/starsky/starsky.feature.health/HealthCheck/PathExistHealthCheck.cs +++ b/starsky/starsky.feature.health/HealthCheck/PathExistHealthCheck.cs @@ -33,7 +33,7 @@ public Task CheckHealthAsync( $"Not configured")); return Task.FromResult( - resultsList.Any(p => p == FolderOrFileModel.FolderOrFileTypeList.Deleted) ? + resultsList.Exists(p => p == FolderOrFileModel.FolderOrFileTypeList.Deleted) ? new HealthCheckResult(context.Registration.FailureStatus, $"Configured path is not present on system") : HealthCheckResult.Healthy("Configured path is present")); } diff --git a/starsky/starsky.feature.health/UpdateCheck/Models/ReleaseModel.cs b/starsky/starsky.feature.health/UpdateCheck/Models/ReleaseModel.cs index f98d219707..2f3655cd86 100644 --- a/starsky/starsky.feature.health/UpdateCheck/Models/ReleaseModel.cs +++ b/starsky/starsky.feature.health/UpdateCheck/Models/ReleaseModel.cs @@ -29,7 +29,7 @@ public string TagName { set { if ( string.IsNullOrWhiteSpace(value)) return; - if ( !value.StartsWith("v") ) Console.WriteLine($"{_tagName} Should start with v"); + if ( !value.StartsWith('v') ) Console.WriteLine($"{_tagName} Should start with v"); _tagName = value; } } diff --git a/starsky/starsky.feature.health/UpdateCheck/Services/CheckForUpdates.cs b/starsky/starsky.feature.health/UpdateCheck/Services/CheckForUpdates.cs index cfc7ef561e..7b0e6d06b8 100644 --- a/starsky/starsky.feature.health/UpdateCheck/Services/CheckForUpdates.cs +++ b/starsky/starsky.feature.health/UpdateCheck/Services/CheckForUpdates.cs @@ -72,8 +72,11 @@ internal static KeyValuePair Parse(IEnumerable p.TagName); var tagName = orderedReleaseModelList.FirstOrDefault(p => !p.Draft && !p.PreRelease)?.TagName; - if ( string.IsNullOrWhiteSpace(tagName) || !tagName.StartsWith("v") ) + if ( string.IsNullOrWhiteSpace(tagName) || + !tagName.StartsWith('v') ) + { return new KeyValuePair(UpdateStatus.NoReleasesFound,string.Empty); + } try { diff --git a/starsky/starsky.feature.import/Services/Import.cs b/starsky/starsky.feature.import/Services/Import.cs index 0c0c68bce9..23a8c28d83 100644 --- a/starsky/starsky.feature.import/Services/Import.cs +++ b/starsky/starsky.feature.import/Services/Import.cs @@ -142,7 +142,7 @@ public async Task> Preflight(List fullFilePathsLis var parentFolder = Directory.GetParent(itemSourceFullFilePath) ?.FullName; - if ( parentFolders.All(p => p.Item1 != parentFolder) ) + if ( parentFolders.TrueForAll(p => p.Item1 != parentFolder) ) { parentFolders.Add(new Tuple>(parentFolder, new List{itemSourceFullFilePath})); continue;