Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions PowerKit/Adler32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public static uint Hash(byte[] data)
}

#if !NETFRAMEWORK || NET45_OR_GREATER
/// <summary>
/// Computes the Adler-32 checksum of the specified data.
/// </summary>
/// <inheritdoc cref="Hash(byte[])" />
public static uint Hash(ReadOnlySpan<byte> data)
{
var a = 1u;
Expand Down
4 changes: 1 addition & 3 deletions PowerKit/Crc32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public static uint Hash(byte[] data)
}

#if !NETFRAMEWORK || NET45_OR_GREATER
/// <summary>
/// Computes the CRC-32 checksum of the specified data.
/// </summary>
/// <inheritdoc cref="Hash(byte[])" />
public static uint Hash(ReadOnlySpan<byte> data)
{
var crc = 0xFFFFFFFFu;
Expand Down
8 changes: 2 additions & 6 deletions PowerKit/Deflate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ public static byte[] Compress(byte[] data)
}

#if !NETFRAMEWORK || NET45_OR_GREATER
/// <summary>
/// Compresses the specified data using the Deflate algorithm.
/// </summary>
/// <inheritdoc cref="Compress(byte[])" />
public static byte[] Compress(ReadOnlySpan<byte> data) => Compress(data.ToArray());
#endif

Expand Down Expand Up @@ -67,9 +65,7 @@ public static byte[] Decompress(byte[] data)
}

#if !NETFRAMEWORK || NET45_OR_GREATER
/// <summary>
/// Decompresses the specified data using the Deflate algorithm.
/// </summary>
/// <inheritdoc cref="Decompress(byte[])" />
public static byte[] Decompress(ReadOnlySpan<byte> data) => Decompress(data.ToArray());
#endif
}
10 changes: 2 additions & 8 deletions PowerKit/Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public static class EnumExtensions
where TEnum : struct, Enum =>
Enum.TryParse<TEnum>(str, ignoreCase, out var result) ? result : null;

/// <summary>
/// Parses the string as an enum value of type <typeparamref name="TEnum" />,
/// returning <see langword="null" /> if parsing fails.
/// </summary>
/// <inheritdoc cref="ParseOrNull{TEnum}(string, bool)" />
public static TEnum? ParseOrNull<TEnum>(string? str)
where TEnum : struct, Enum => Enum.ParseOrNull<TEnum>(str, false);

Expand All @@ -35,10 +32,7 @@ public static TEnum ParseOrDefault<TEnum>(
)
where TEnum : struct, Enum => Enum.ParseOrNull<TEnum>(str, ignoreCase) ?? defaultValue;

/// <summary>
/// Parses the string as an enum value of type <typeparamref name="TEnum" />,
/// returning <paramref name="defaultValue" /> if parsing fails.
/// </summary>
/// <inheritdoc cref="ParseOrDefault{TEnum}(string, bool, TEnum)" />
public static TEnum ParseOrDefault<TEnum>(string? str, TEnum defaultValue = default)
where TEnum : struct, Enum => Enum.ParseOrDefault(str, false, defaultValue);
}
Expand Down
5 changes: 1 addition & 4 deletions PowerKit/Extensions/FileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ public static bool Contains(string path, ReadOnlySpan<byte> bytes)
return false;
}

/// <summary>
/// Checks whether the file at the specified path contains the given byte sequence.
/// Returns <see langword="true" /> if <paramref name="bytes" /> is empty.
/// </summary>
/// <inheritdoc cref="Contains(string, ReadOnlySpan{byte})" />
public static bool Contains(string path, byte[] bytes) =>
File.Contains(path, new ReadOnlySpan<byte>(bytes));
#endif
Expand Down
8 changes: 2 additions & 6 deletions PowerKit/Extensions/HttpClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ await response
.ConfigureAwait(false);
}

/// <summary>
/// Downloads the content at the specified URI to a local file.
/// </summary>
/// <inheritdoc />
Comment thread
Tyrrrz marked this conversation as resolved.
Outdated
public async Task DownloadAsync(
string requestUri,
string filePath,
Expand Down Expand Up @@ -74,9 +72,7 @@ public async Task<HttpResponseMessage> HeadAsync(
.ConfigureAwait(false);
}

/// <summary>
/// Sends a HEAD request to the specified URI and returns the response.
/// </summary>
/// <inheritdoc />
public async Task<HttpResponseMessage> HeadAsync(
string requestUri,
CancellationToken cancellationToken = default
Expand Down