Skip to content

Commit d38764d

Browse files
committed
remove explicit backing fields for property bags
1 parent 8738afe commit d38764d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/ImageSharp/Configuration.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public sealed class Configuration
2828

2929
private int maxDegreeOfParallelism = Environment.ProcessorCount;
3030

31-
private Dictionary<object, object> properties = new Dictionary<object, object>();
32-
3331
/// <summary>
3432
/// Initializes a new instance of the <see cref="Configuration" /> class.
3533
/// </summary>
@@ -80,7 +78,7 @@ public int MaxDegreeOfParallelism
8078
/// Gets a set of properties for the Congiguration.
8179
/// </summary>
8280
/// <remarks>This can be used for storing global settings and defaults to be accessable to processors.</remarks>
83-
public IDictionary<object, object> Properties => this.properties;
81+
public IDictionary<object, object> Properties { get; } = new Dictionary<object, object>();
8482

8583
/// <summary>
8684
/// Gets the currently registered <see cref="IImageFormat"/>s.

src/ImageSharp/Processing/DefaultImageProcessorContext{TPixel}.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ internal class DefaultImageProcessorContext<TPixel> : IInternalImageProcessingCo
1616
{
1717
private readonly bool mutate;
1818
private readonly Image<TPixel> source;
19-
private readonly Dictionary<object, object> properties = new Dictionary<object, object>();
2019
private Image<TPixel> destination;
2120

2221
/// <summary>
@@ -42,7 +41,7 @@ public DefaultImageProcessorContext(Configuration configuration, Image<TPixel> s
4241
public Configuration Configuration { get; }
4342

4443
/// <inheritdoc/>
45-
public IDictionary<object, object> Properties => this.properties;
44+
public IDictionary<object, object> Properties { get; } = new Dictionary<object, object>();
4645

4746
/// <inheritdoc/>
4847
public Image<TPixel> GetResultImage()

0 commit comments

Comments
 (0)