Fix IDE0090
This commit is contained in:
committed by
Pavel Penev
parent
164abfdae1
commit
8a285f9b19
@@ -16,9 +16,9 @@ namespace OpenRA
|
||||
{
|
||||
public class Arguments
|
||||
{
|
||||
readonly Dictionary<string, string> args = new Dictionary<string, string>();
|
||||
readonly Dictionary<string, string> args = new();
|
||||
|
||||
public static Arguments Empty => new Arguments();
|
||||
public static Arguments Empty => new();
|
||||
|
||||
public Arguments(params string[] src)
|
||||
{
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace OpenRA.Support
|
||||
|
||||
public class AssemblyLoadContextBuilder
|
||||
{
|
||||
readonly Dictionary<string, ManagedLibrary> managedLibraries = new Dictionary<string, ManagedLibrary>(StringComparer.Ordinal);
|
||||
readonly Dictionary<string, NativeLibrary> nativeLibraries = new Dictionary<string, NativeLibrary>(StringComparer.Ordinal);
|
||||
readonly Dictionary<string, ManagedLibrary> managedLibraries = new(StringComparer.Ordinal);
|
||||
readonly Dictionary<string, NativeLibrary> nativeLibraries = new(StringComparer.Ordinal);
|
||||
string basePath;
|
||||
|
||||
public AssemblyLoadContext Build()
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Support
|
||||
class Benchmark
|
||||
{
|
||||
readonly string prefix;
|
||||
readonly Dictionary<string, List<BenchmarkPoint>> samples = new Dictionary<string, List<BenchmarkPoint>>();
|
||||
readonly Dictionary<string, List<BenchmarkPoint>> samples = new();
|
||||
|
||||
public Benchmark(string prefix)
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA.Support
|
||||
}
|
||||
|
||||
static readonly Dictionary<string, int> Prec
|
||||
= new Dictionary<string, int> { { "+", 0 }, { "-", 0 }, { "*", 1 }, { "/", 1 }, { "(", -1 } };
|
||||
= new() { { "+", 0 }, { "-", 0 }, { "*", 1 }, { "/", 1 }, { "(", -1 } };
|
||||
|
||||
static IEnumerable<string> Tokens(string expr, string ops)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Support
|
||||
static readonly TimeSpan ConnectionLifeTime = TimeSpan.FromMinutes(1);
|
||||
#endif
|
||||
|
||||
static readonly Lazy<HttpMessageHandler> Handler = new Lazy<HttpMessageHandler>(GetHandler);
|
||||
static readonly Lazy<HttpMessageHandler> Handler = new(GetHandler);
|
||||
|
||||
public static HttpClient Create()
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Support
|
||||
public class HttpQueryBuilder : IEnumerable
|
||||
{
|
||||
readonly string url;
|
||||
readonly List<Parameter> parameters = new List<Parameter>();
|
||||
readonly List<Parameter> parameters = new();
|
||||
|
||||
public HttpQueryBuilder(string url)
|
||||
{
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace OpenRA
|
||||
{
|
||||
const int CreateLogFileMaxRetryCount = 128;
|
||||
|
||||
static readonly ConcurrentDictionary<string, ChannelInfo> Channels = new ConcurrentDictionary<string, ChannelInfo>();
|
||||
static readonly ConcurrentDictionary<string, ChannelInfo> Channels = new();
|
||||
static readonly Channel<ChannelData> Channel;
|
||||
static readonly ChannelWriter<ChannelData> ChannelWriter;
|
||||
static readonly CancellationTokenSource CancellationToken = new CancellationTokenSource();
|
||||
static readonly CancellationTokenSource CancellationToken = new();
|
||||
|
||||
static readonly TimeSpan FlushInterval = TimeSpan.FromSeconds(5);
|
||||
static readonly Timer Timer;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Support
|
||||
|
||||
static int nextColor;
|
||||
|
||||
public static Cache<string, PerfItem> Items = new Cache<string, PerfItem>(
|
||||
public static Cache<string, PerfItem> Items = new(
|
||||
s =>
|
||||
{
|
||||
var x = new PerfItem(s, Colors[nextColor++]);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Support
|
||||
List<PerfTimer> children;
|
||||
long ticks;
|
||||
|
||||
static readonly ThreadLocal<PerfTimer> ParentThreadLocal = new ThreadLocal<PerfTimer>();
|
||||
static readonly ThreadLocal<PerfTimer> ParentThreadLocal = new();
|
||||
|
||||
public PerfTimer(string name, float thresholdMs = 0)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Support
|
||||
public static readonly IReadOnlyDictionary<string, int> NoVariables = new ReadOnlyDictionary<string, int>(new Dictionary<string, int>());
|
||||
|
||||
public readonly string Expression;
|
||||
readonly HashSet<string> variables = new HashSet<string>();
|
||||
readonly HashSet<string> variables = new();
|
||||
public IEnumerable<string> Variables => variables;
|
||||
|
||||
enum CharClass { Whitespace, Operator, Mixed, Id, Digit }
|
||||
@@ -716,8 +716,8 @@ namespace OpenRA.Support
|
||||
|
||||
class AstStack
|
||||
{
|
||||
readonly List<Expression> expressions = new List<Expression>();
|
||||
readonly List<ExpressionType> types = new List<ExpressionType>();
|
||||
readonly List<Expression> expressions = new();
|
||||
readonly List<ExpressionType> types = new();
|
||||
|
||||
public ExpressionType PeekType() { return types[^1]; }
|
||||
|
||||
@@ -774,7 +774,7 @@ namespace OpenRA.Support
|
||||
|
||||
class Compiler
|
||||
{
|
||||
readonly AstStack ast = new AstStack();
|
||||
readonly AstStack ast = new();
|
||||
|
||||
public Expression Build(Token[] postfix, ExpressionType resultType)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user