Use collection expressions to create empty collections
このコミットが含まれているのは:
1 親
358f378796
コミット
8dc70916ac
13ファイル変更
+19
-19
検索条件に一致するファイルはありません
@@ -17,7 +17,7 @@ public abstract partial class CanvasEffect : ICanvasImage, ICanvasImageInterop.I
|
||||
/// <remarks>
|
||||
/// When not empty (ie. when an effect graph has been built), this will always also include <see cref="canvasImage"/>.
|
||||
/// </remarks>
|
||||
private readonly Dictionary<object, ICanvasImage> transformNodes = new();
|
||||
private readonly Dictionary<object, ICanvasImage> transformNodes = [];
|
||||
|
||||
/// <summary>
|
||||
/// The current cached result for <see cref="GetCanvasImage"/>, if available.
|
||||
|
||||
@@ -12,7 +12,7 @@ internal sealed class SemanticModelProvider(Compilation compilation)
|
||||
/// <summary>
|
||||
/// The map of loaded <see cref="SemanticModel"/> instances.
|
||||
/// </summary>
|
||||
private readonly Dictionary<SyntaxTree, SemanticModel> semanticModelsMap = new();
|
||||
private readonly Dictionary<SyntaxTree, SemanticModel> semanticModelsMap = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="SemanticModel"/> instance with info on a given <see cref="SyntaxNode"/>.
|
||||
|
||||
@@ -166,7 +166,7 @@ internal static partial class HlslKnownMethods
|
||||
{
|
||||
ILookup<string, MethodInfo> methodsLookup = typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static).ToLookup(static method => method.Name);
|
||||
|
||||
Dictionary<string, string> knownMethods = new();
|
||||
Dictionary<string, string> knownMethods = [];
|
||||
|
||||
// Go through the previously discovered methods to find the ones requiring parameters mapping
|
||||
foreach (KeyValuePair<string, string> pair in KnownMethods)
|
||||
|
||||
@@ -21,7 +21,7 @@ internal static partial class HlslKnownOperators
|
||||
/// </summary>
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownOperatorsMap()
|
||||
{
|
||||
Dictionary<string, string> knownOperators = new();
|
||||
Dictionary<string, string> knownOperators = [];
|
||||
|
||||
// Programmatically load mappings for the intrinsic operators on each HLSL primitive type
|
||||
foreach ((Type Type, MethodInfo Operator, string IntrinsicName, bool RequiresParametersMatching) item in
|
||||
|
||||
@@ -87,8 +87,8 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter
|
||||
this.shaderType = shaderType;
|
||||
this.staticMethods = staticMethods;
|
||||
this.instanceMethods = instanceMethods;
|
||||
this.localFunctions = new();
|
||||
this.implicitVariables = new();
|
||||
this.localFunctions = [];
|
||||
this.implicitVariables = [];
|
||||
this.isEntryPoint = isEntryPoint;
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter
|
||||
{
|
||||
this.staticMethods = staticMethods;
|
||||
this.instanceMethods = instanceMethods;
|
||||
this.implicitVariables = new();
|
||||
this.localFunctions = new();
|
||||
this.implicitVariables = [];
|
||||
this.localFunctions = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -170,7 +170,7 @@ public sealed unsafe partial class GraphicsDevice : IReferenceTrackedObject
|
||||
IsCacheCoherentUMA = d3D12Architecture1Data.CacheCoherentUMA != 0;
|
||||
|
||||
this.deviceRemovedReason = S.S_OK;
|
||||
this.cachedPipelineData = new List<PipelineData>();
|
||||
this.cachedPipelineData = [];
|
||||
|
||||
RegisterDeviceLostCallback(this, out this.deviceHandle, out this.deviceRemovedEvent, out this.deviceRemovedWaitHandle);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ unsafe partial class DeviceHelper
|
||||
/// <summary>
|
||||
/// The local cache of <see cref="GraphicsDevice"/> instances that are currently usable.
|
||||
/// </summary>
|
||||
internal static readonly Dictionary<Luid, GraphicsDevice> DevicesCache = new();
|
||||
internal static readonly Dictionary<Luid, GraphicsDevice> DevicesCache = [];
|
||||
|
||||
/// <summary>
|
||||
/// The local map of <see cref="ID3D12InfoQueue"/> instances for the existing devices.
|
||||
/// </summary>
|
||||
private static readonly Dictionary<Luid, ComPtr<ID3D12InfoQueue>> D3D12InfoQueueMap = new();
|
||||
private static readonly Dictionary<Luid, ComPtr<ID3D12InfoQueue>> D3D12InfoQueueMap = [];
|
||||
|
||||
/// <summary>
|
||||
/// The cached default <see cref="GraphicsDevice"/> instance, if any.
|
||||
|
||||
@@ -19,7 +19,7 @@ internal static unsafe class PipelineDataLoader<T>
|
||||
/// <summary>
|
||||
/// The map of cached <see cref="PipelineData"/> instances for each GPU in use.
|
||||
/// </summary>
|
||||
private static readonly ConditionalWeakTable<GraphicsDevice, PipelineData> CachedPipelines = new();
|
||||
private static readonly ConditionalWeakTable<GraphicsDevice, PipelineData> CachedPipelines = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="PipelineData"/> instance for a given shader.
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする