Skip to content

Commit d1c3c31

Browse files
committed
Nextfixes
1 parent 1be9491 commit d1c3c31

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/ImageSharp/Formats/ImageFormatManager.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ public void AddImageFormat(IImageFormat format)
8383

8484
lock (HashLock)
8585
{
86-
if (!this.imageFormats.Contains(format))
87-
{
88-
this.imageFormats.Add(format);
89-
}
86+
this.imageFormats.Add(format);
9087
}
9188
}
9289

src/ImageSharp/Formats/Png/PngDecoderCore.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,8 +1938,7 @@ private static bool TryReadTextKeyword(ReadOnlySpan<byte> keywordBytes, out stri
19381938
// Keywords should not be empty or have leading or trailing whitespace.
19391939
name = PngConstants.Encoding.GetString(keywordBytes);
19401940
return !string.IsNullOrWhiteSpace(name)
1941-
&& !name.StartsWith(" ", StringComparison.Ordinal)
1942-
&& !name.EndsWith(" ", StringComparison.Ordinal);
1941+
&& !name.StartsWith(' ') && !name.EndsWith(' ');
19431942
}
19441943

19451944
private static bool IsXmpTextData(ReadOnlySpan<byte> keywordBytes)

0 commit comments

Comments
 (0)