From 2d6c1746063a19a5f0b1ca2871035ad7c4d75dc3 Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Fri, 3 Feb 2023 16:49:13 +0100 Subject: [PATCH] Initialize is only needed in the constructor. It would just return on the other invocations --- .../Metadata/Profiles/IPTC/IptcProfile.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs index d7bd09758b..162fae96b3 100644 --- a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs +++ b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs @@ -78,14 +78,7 @@ public sealed class IptcProfile : IDeepCloneable /// /// Gets the values of this iptc profile. /// - public IEnumerable Values - { - get - { - this.Initialize(); - return this.values; - } - } + public IEnumerable Values => this.values; /// public IptcProfile DeepClone() => new(this); @@ -116,8 +109,6 @@ public sealed class IptcProfile : IDeepCloneable /// True when the value was found and removed. public bool RemoveValue(IptcTag tag) { - this.Initialize(); - bool removed = false; for (int i = this.values.Count - 1; i >= 0; i--) { @@ -139,8 +130,6 @@ public sealed class IptcProfile : IDeepCloneable /// True when the value was found and removed. public bool RemoveValue(IptcTag tag, string value) { - this.Initialize(); - bool removed = false; for (int i = this.values.Count - 1; i >= 0; i--) {