Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Oct 8, 2023
1 parent 553ab5f commit c65c886
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Argon/JsonConvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,22 @@ internal static string ToString(Uri value, char quoteChar) =>
/// Converts the <see cref="String" /> to its JSON string representation.
/// </summary>
/// <returns>A JSON string representation of the <see cref="String" />.</returns>
public static string ToString(string? value) =>
public static string ToString(string value) =>
ToString(value, '"');

/// <summary>
/// Converts the <see cref="String" /> to its JSON string representation.
/// </summary>
/// <param name="delimiter">The string delimiter character.</param>
/// <returns>A JSON string representation of the <see cref="String" />.</returns>
public static string ToString(string? value, char delimiter) =>
public static string ToString(string value, char delimiter) =>
ToString(value, delimiter, EscapeHandling.Default);

/// <summary>
/// Converts the <see cref="String" /> to its JSON string representation.
/// </summary>
/// <returns>A JSON string representation of the <see cref="String" />.</returns>
public static string ToString(string? value, char delimiter, EscapeHandling escapeHandling)
public static string ToString(string value, char delimiter, EscapeHandling escapeHandling)
{
if (delimiter != '"' &&
delimiter != '\'')
Expand Down
6 changes: 3 additions & 3 deletions src/Argon/Utilities/JavaScriptUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static bool ShouldEscapeJavaScriptString(string? s)
return false;
}

public static void WriteEscapedJavaScriptString(TextWriter writer, string? value, char delimiter, bool appendDelimiters, bool[] escapeFlags, EscapeHandling escapeHandling, ref char[]? buffer)
public static void WriteEscapedJavaScriptString(TextWriter writer, string value, char delimiter, bool appendDelimiters, bool[] escapeFlags, EscapeHandling escapeHandling, ref char[]? buffer)
{
// leading delimiter
if (appendDelimiters)
Expand Down Expand Up @@ -261,11 +261,11 @@ static void WriteEscapedJavaScriptNonNullString(TextWriter writer, string value,
}
}

public static string ToEscapedJavaScriptString(string? value, char delimiter, bool appendDelimiters, EscapeHandling escapeHandling)
public static string ToEscapedJavaScriptString(string value, char delimiter, bool appendDelimiters, EscapeHandling escapeHandling)
{
var escapeFlags = GetCharEscapeFlags(escapeHandling, delimiter);

using var w = StringUtils.CreateStringWriter(value?.Length ?? 16);
using var w = StringUtils.CreateStringWriter(value.Length);
char[]? buffer = null;
WriteEscapedJavaScriptString(w, value, delimiter, appendDelimiters, escapeFlags, escapeHandling, ref buffer);
return w.ToString();
Expand Down

0 comments on commit c65c886

Please sign in to comment.