From 8908dba6cfc16ce02adaec7c1730f5303b78e8cb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 5 Oct 2023 13:41:57 +1000 Subject: [PATCH] Minor AOT fixes and .NET 7 fixes. --- src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs | 2 +- src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs b/src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs index 1f7c7586e..469e4c9ab 100644 --- a/src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs +++ b/src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs @@ -502,7 +502,7 @@ internal class Vp8LEncoder : IDisposable doNotCache = true; // Go brute force on all transforms. - foreach (EntropyIx entropyIx in Enum.GetValues(typeof(EntropyIx)).Cast()) + foreach (EntropyIx entropyIx in Enum.GetValues()) { // We can only apply kPalette or kPaletteAndSpatial if we can indeed use a palette. if ((entropyIx != EntropyIx.Palette && entropyIx != EntropyIx.PaletteAndSpatial) || usePalette) diff --git a/src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs b/src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs index 0fe01fbdb..45074c9a6 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs @@ -88,9 +88,9 @@ internal sealed class IccReader foreach (IccTagTableEntry tag in tagTable) { IccTagDataEntry entry; - if (store.ContainsKey(tag.Offset)) + if (store.TryGetValue(tag.Offset, out IccTagDataEntry? value)) { - entry = store[tag.Offset]; + entry = value; } else {