From 88acfa05316598b0248bc877f9fca372875f29be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 2 Dec 2024 12:16:29 +0000 Subject: [PATCH] fix: Remove null checks for args in GetArgumentIndex and GetArgumentValue methods for cleaner logic --- AzureLiquid.Preview/PreviewProcessArguments.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AzureLiquid.Preview/PreviewProcessArguments.cs b/AzureLiquid.Preview/PreviewProcessArguments.cs index 2a490c7..251a6c2 100644 --- a/AzureLiquid.Preview/PreviewProcessArguments.cs +++ b/AzureLiquid.Preview/PreviewProcessArguments.cs @@ -23,7 +23,7 @@ public class PreviewProcessArguments /// The index of the argument. private static int GetArgumentIndex(string[] args, string key) { - for (int i = 0; i < args?.Length; i++) + for (int i = 0; i < args.Length; i++) { if (IsArgMatch(args[i], key)) { @@ -65,7 +65,7 @@ public string ParsePath(string[] args, string key) { var index = GetArgumentIndex(args, key); return - index == -1 || index - 1 >= args?.Length || args == null + index == -1 || index - 1 >= args.Length ? string.Empty // No match, or no arguments passed : Path.GetFullPath(args[index + 1], _path); // Argument found, parsing path }