From 65cd1cede3120412d90965179da63f803a9c3cd1 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 3 Nov 2024 23:14:22 -0500 Subject: [PATCH] Remove last instances of ValueTuple usage --- CHANGELIST.md | 1 + MPF.CLI/MPF.CLI.csproj | 6 ------ MPF.CLI/Program.cs | 14 +++++++++----- MPF.Check/MPF.Check.csproj | 6 ------ MPF.Check/Program.cs | 14 +++++++++----- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index b7dc1baf..f3fd23ed 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -34,6 +34,7 @@ - Replace user info func with ProcessUserInfoDelegate - Reduce tupling even more - Remove tupling from everything except CLI programs +- Remove last instances of ValueTuple usage ### 3.2.2 (2024-09-24) diff --git a/MPF.CLI/MPF.CLI.csproj b/MPF.CLI/MPF.CLI.csproj index 0dd74876..5a08c3ad 100644 --- a/MPF.CLI/MPF.CLI.csproj +++ b/MPF.CLI/MPF.CLI.csproj @@ -41,17 +41,11 @@ - - - - - - diff --git a/MPF.CLI/Program.cs b/MPF.CLI/Program.cs index 2e67d646..9a3e56e0 100644 --- a/MPF.CLI/Program.cs +++ b/MPF.CLI/Program.cs @@ -60,7 +60,8 @@ namespace MPF.CLI Console.WriteLine(message); // Process any custom parameters - (CommandOptions opts, int startIndex) = LoadFromArguments(args, options, startIndex: 2); + int startIndex = 2; + CommandOptions opts = LoadFromArguments(args, options, ref startIndex); // Validate the internal program switch (options.InternalProgram) @@ -209,18 +210,21 @@ namespace MPF.CLI /// /// Load the current set of options from application arguments /// - private static (CommandOptions, int) LoadFromArguments(string[] args, Frontend.Options options, int startIndex = 0) + private static CommandOptions LoadFromArguments(string[] args, Frontend.Options options, ref int startIndex) { // Create return values var opts = new CommandOptions(); // If we have no arguments, just return if (args == null || args.Length == 0) - return (opts, 0); + { + startIndex = 0; + return opts; + } // If we have an invalid start index, just return if (startIndex < 0 || startIndex >= args.Length) - return (opts, startIndex); + return opts; // Loop through the arguments and parse out values for (; startIndex < args.Length; startIndex++) @@ -306,7 +310,7 @@ namespace MPF.CLI } } - return (opts, startIndex); + return opts; } /// diff --git a/MPF.Check/MPF.Check.csproj b/MPF.Check/MPF.Check.csproj index 13f44165..9949b76c 100644 --- a/MPF.Check/MPF.Check.csproj +++ b/MPF.Check/MPF.Check.csproj @@ -45,17 +45,11 @@ - - - - - - diff --git a/MPF.Check/Program.cs b/MPF.Check/Program.cs index 3511384a..fe689510 100644 --- a/MPF.Check/Program.cs +++ b/MPF.Check/Program.cs @@ -63,7 +63,8 @@ namespace MPF.Check } // Loop through and process options - (CommandOptions opts, int startIndex) = LoadFromArguments(args, options, startIndex: 2); + int startIndex = 2; + CommandOptions opts = LoadFromArguments(args, options, ref startIndex); if (options.InternalProgram == InternalProgram.NONE) { DisplayHelp("A program name needs to be provided"); @@ -158,7 +159,7 @@ namespace MPF.Check /// /// Load the current set of options from application arguments /// - private static (CommandOptions, int) LoadFromArguments(string[] args, Frontend.Options options, int startIndex = 0) + private static CommandOptions LoadFromArguments(string[] args, Frontend.Options options, ref int startIndex) { // Create return values var opts = new CommandOptions(); @@ -172,11 +173,14 @@ namespace MPF.Check // If we have no arguments, just return if (args == null || args.Length == 0) - return (opts, 0); + { + startIndex = 0; + return opts; + } // If we have an invalid start index, just return if (startIndex < 0 || startIndex >= args.Length) - return (opts, startIndex); + return opts; // Loop through the arguments and parse out values for (; startIndex < args.Length; startIndex++) @@ -324,7 +328,7 @@ namespace MPF.Check options.IncludeDebugProtectionInformation = enableDebug && scan && !string.IsNullOrEmpty(opts.DevicePath); options.HideDriveLetters = hideDriveLetters && scan && !string.IsNullOrEmpty(opts.DevicePath); - return (opts, startIndex); + return opts; } ///