Skip to content

Commit

Permalink
fix: Remove null checks for args in GetArgumentIndex and GetArgumentV…
Browse files Browse the repository at this point in the history
…alue methods for cleaner logic
  • Loading branch information
github-actions[bot] committed Dec 2, 2024
1 parent f28966f commit 88acfa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AzureLiquid.Preview/PreviewProcessArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class PreviewProcessArguments
/// <returns>The index of the argument.</returns>
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))
{
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 88acfa0

Please sign in to comment.