From aa522d496cefc8df58bee5b1615537c880389cb7 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 7 Jan 2016 20:16:17 +1100 Subject: [PATCH] Minor optimisations Former-commit-id: 29042a39cda4cf3e8b50d66292c877db2fda8c2d Former-commit-id: b133abc88402677d2b65df54be481f9d8197c32c Former-commit-id: 7edec27867e0850ccd5bd8d3537c6479b694ada4 --- src/ImageProcessor/Samplers/Resampler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor/Samplers/Resampler.cs b/src/ImageProcessor/Samplers/Resampler.cs index 6a506a377..835144ae7 100644 --- a/src/ImageProcessor/Samplers/Resampler.cs +++ b/src/ImageProcessor/Samplers/Resampler.cs @@ -277,7 +277,7 @@ namespace ImageProcessor.Samplers Weight[] horizontalValues = this.horizontalWeights[x].Values; // Destination color components - Color destination = new Color(0, 0, 0, 0); + Color destination = new Color(); foreach (Weight yw in verticalValues) { @@ -371,7 +371,7 @@ namespace ImageProcessor.Samplers } // Normalise the values - if (Math.Abs(sum) > 0.00001f) + if (sum > 0 || sum < 0) { builder.ForEach(w => w.Value /= sum); }