Browse Source

Do not clone ImageProperties

We're using a structure that is already copied with two immutable values
af/merge-core
Jason Nelson 8 years ago
parent
commit
6f06a07f62
  1. 3
      src/ImageSharp/MetaData/ImageMetaData.cs
  2. 15
      src/ImageSharp/MetaData/ImageProperty.cs

3
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
/// <summary>
/// Gets the list of properties for storing meta information about this image.
/// </summary>
/// <value>A list of image properties.</value>
public IList<ImageProperty> Properties { get; } = new List<ImageProperty>();
/// <summary>

15
src/ImageSharp/MetaData/ImageProperty.cs

@ -25,21 +25,6 @@ namespace SixLabors.ImageSharp.MetaData
this.Value = value;
}
/// <summary>
/// Initializes a new instance of the <see cref="ImageProperty"/> struct
/// by making a copy from another property.
/// </summary>
/// <param name="other">
/// The other <see cref="ImageProperty"/> to create this instance from.
/// </param>
internal ImageProperty(ImageProperty other)
{
DebugGuard.NotNull(other, nameof(other));
this.Name = other.Name;
this.Value = other.Value;
}
/// <summary>
/// Gets the name of this <see cref="ImageProperty"/> indicating which kind of
/// information this property stores.

Loading…
Cancel
Save