From fc7fb1ff4bd8a88999ecafeeba8eaa278d52c702 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 17 Dec 2016 22:03:00 +1100 Subject: [PATCH] Remove allocation in octree quantizer. --- src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs b/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs index b65bd2278..6bffeb5e1 100644 --- a/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs +++ b/src/ImageSharp/Quantizers/Octree/OctreeQuantizer.cs @@ -182,8 +182,7 @@ namespace ImageSharp.Quantizers TPacked packed = pixel.PackedValue; // Check if this request is for the same color as the last - // TODO: We should change our TPacked signature to ensure we can compare values without boxing allocations. - if (this.previousColor.Equals((IEquatable)packed)) + if (this.previousColor.Equals(packed)) { // If so, check if I have a previous node setup. This will only occur if the first color in the image // happens to be black, with an alpha component of zero.