Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use collection expressions #38

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 2 deletions src/Core/Configuration/CPluginEnvConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CPlugin.Net;
/// </remarks>
public class CPluginEnvConfiguration : CPluginConfigurationBase
{
private static readonly string[] s_separator = { " ", "\t", "\r\n", "\n", "\r" };
private static readonly string[] s_separator = [" ", "\t", "\r\n", "\n", "\r"];

/// <summary>
/// Initializes a new instance of the <see cref="CPluginEnvConfiguration"/> class.
Expand All @@ -26,7 +26,7 @@ public override IEnumerable<string> GetPluginFiles()
{
var retrievedValue = Environment.GetEnvironmentVariable("PLUGINS");
if(retrievedValue is null)
return Enumerable.Empty<string>();
return [];

var pluginFiles = retrievedValue
.Split(s_separator, StringSplitOptions.None)
Expand Down
4 changes: 1 addition & 3 deletions src/Core/Configuration/CPluginJsonConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public override IEnumerable<string> GetPluginFiles()
.GetSection("Plugins")
.Get<string[]>();

return values is null ?
Enumerable.Empty<string>() :
values.Select(GetPluginPath);
return values is null ? [] : values.Select(GetPluginPath);
}
}
Loading