Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-z committed Dec 16, 2024
1 parent 7bfaddc commit da41786
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NGitLab/Impl/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ public static string AddParameter(string url, string parameterName, long? value)

public static string AddParameter(string url, string parameterName, DateTime? date)
{
return Equals(date, null) ? url : AddParameterInternal(url, parameterName, date.Value.ToString("O"));
return !date.HasValue ? url : AddParameterInternal(url, parameterName, date.Value.ToString("O"));
}

public static string AddParameter(string url, string parameterName, long[] values)
{
return Equals(values, null) ? url : AddParameterInternal(url, parameterName, string.Join(",", values));
return values is null ? url : AddParameterInternal(url, parameterName, string.Join(",", values.Select(v => v.ToString(CultureInfo.InvariantCulture))));
}

public static string AddArrayParameter(string url, string parameterName, string[] values)
{
if (Equals(values, null))
if (values is null)
{
return url;
}
Expand Down

0 comments on commit da41786

Please sign in to comment.