From d38764dba2cbcf68b25778a304b5ab2b794b3754 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 22 Apr 2020 09:02:03 +0100 Subject: [PATCH] remove explicit backing fields for property bags --- src/ImageSharp/Configuration.cs | 4 +--- .../Processing/DefaultImageProcessorContext{TPixel}.cs | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index b2d819f1c..17ac8c3fd 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -28,8 +28,6 @@ namespace SixLabors.ImageSharp private int maxDegreeOfParallelism = Environment.ProcessorCount; - private Dictionary properties = new Dictionary(); - /// /// Initializes a new instance of the class. /// @@ -80,7 +78,7 @@ namespace SixLabors.ImageSharp /// Gets a set of properties for the Congiguration. /// /// This can be used for storing global settings and defaults to be accessable to processors. - public IDictionary Properties => this.properties; + public IDictionary Properties { get; } = new Dictionary(); /// /// Gets the currently registered s. diff --git a/src/ImageSharp/Processing/DefaultImageProcessorContext{TPixel}.cs b/src/ImageSharp/Processing/DefaultImageProcessorContext{TPixel}.cs index 5ee3f6483..714a45f5f 100644 --- a/src/ImageSharp/Processing/DefaultImageProcessorContext{TPixel}.cs +++ b/src/ImageSharp/Processing/DefaultImageProcessorContext{TPixel}.cs @@ -16,7 +16,6 @@ namespace SixLabors.ImageSharp.Processing { private readonly bool mutate; private readonly Image source; - private readonly Dictionary properties = new Dictionary(); private Image destination; /// @@ -42,7 +41,7 @@ namespace SixLabors.ImageSharp.Processing public Configuration Configuration { get; } /// - public IDictionary Properties => this.properties; + public IDictionary Properties { get; } = new Dictionary(); /// public Image GetResultImage()