From 6f06a07f626d849a183f8be1e141021e8fe57e7b Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Wed, 18 Apr 2018 12:03:30 -0700 Subject: [PATCH] Do not clone ImageProperties We're using a structure that is already copied with two immutable values --- src/ImageSharp/MetaData/ImageMetaData.cs | 3 +-- src/ImageSharp/MetaData/ImageProperty.cs | 15 --------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/ImageSharp/MetaData/ImageMetaData.cs b/src/ImageSharp/MetaData/ImageMetaData.cs index 9613e9b465..df114ce9fb 100644 --- a/src/ImageSharp/MetaData/ImageMetaData.cs +++ b/src/ImageSharp/MetaData/ImageMetaData.cs @@ -53,7 +53,7 @@ namespace SixLabors.ImageSharp.MetaData foreach (ImageProperty property in other.Properties) { - this.Properties.Add(new ImageProperty(property)); + this.Properties.Add(property); } this.ExifProfile = other.ExifProfile != null @@ -114,7 +114,6 @@ namespace SixLabors.ImageSharp.MetaData /// /// Gets the list of properties for storing meta information about this image. /// - /// A list of image properties. public IList Properties { get; } = new List(); /// diff --git a/src/ImageSharp/MetaData/ImageProperty.cs b/src/ImageSharp/MetaData/ImageProperty.cs index e4f60e8b33..c67c1f3cf9 100644 --- a/src/ImageSharp/MetaData/ImageProperty.cs +++ b/src/ImageSharp/MetaData/ImageProperty.cs @@ -25,21 +25,6 @@ namespace SixLabors.ImageSharp.MetaData this.Value = value; } - /// - /// Initializes a new instance of the struct - /// by making a copy from another property. - /// - /// - /// The other to create this instance from. - /// - internal ImageProperty(ImageProperty other) - { - DebugGuard.NotNull(other, nameof(other)); - - this.Name = other.Name; - this.Value = other.Value; - } - /// /// Gets the name of this indicating which kind of /// information this property stores.