Browse Source

Eliminate allocation in invalid icc profile

pull/747/head
Jason Nelson 8 years ago
parent
commit
a80335d9e0
  1. 3
      src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs

3
src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
@ -126,7 +127,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
// A normal profile usually has 5-15 entries // A normal profile usually has 5-15 entries
if (tagCount > 100) if (tagCount > 100)
{ {
return new IccTagTableEntry[0]; return Array.Empty<IccTagTableEntry>();
} }
var table = new List<IccTagTableEntry>((int)tagCount); var table = new List<IccTagTableEntry>((int)tagCount);

Loading…
Cancel
Save