From fd4cd4145b3bc0c2568fc8b8cd9cb087ce9cc541 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: 732ec6eb4f12e9d029f60e7a8149ae353828e3c7 Former-commit-id: e5c071029115af00af8b7f61932de5acbb860bdc Former-commit-id: c298b38efe3ddcfb3038c1177affa2e139a47149 --- 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); }