Skip to content

Commit

Permalink
Minor AOT fixes and .NET 7 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Oct 5, 2023
1 parent a794ac1 commit 8908dba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private CrunchConfig[] EncoderAnalyze(ReadOnlySpan<uint> bgra, int width, int he
doNotCache = true;

// Go brute force on all transforms.
foreach (EntropyIx entropyIx in Enum.GetValues(typeof(EntropyIx)).Cast<EntropyIx>())
foreach (EntropyIx entropyIx in Enum.GetValues<EntropyIx>())
{
// We can only apply kPalette or kPaletteAndSpatial if we can indeed use a palette.
if ((entropyIx != EntropyIx.Palette && entropyIx != EntropyIx.PaletteAndSpatial) || usePalette)
Expand Down
4 changes: 2 additions & 2 deletions src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ private static IccTagDataEntry[] ReadTagData(IccDataReader reader)
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
{
Expand Down

0 comments on commit 8908dba

Please sign in to comment.