From 20ff3ab0a1d6de40d877361f64f8b65f9b84a409 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Sun, 23 Sep 2018 20:55:34 +0200 Subject: [PATCH] fix typo, improve DivideCeil --- .../Processing/Processors/Drawing/DrawImageProcessor.cs | 2 +- src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs index add34ca36c..dc73420f30 100644 --- a/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs +++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs @@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Drawing /// Combines two images together by blending the pixels. /// /// The pixel format of destination image. - /// The pixel format os source image. + /// The pixel format of source image. internal class DrawImageProcessor : ImageProcessor where TPixelDst : struct, IPixel where TPixelSrc : struct, IPixel diff --git a/src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs b/src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs index 1f999cfd2b..1d1734a863 100644 --- a/src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs +++ b/src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs @@ -141,11 +141,6 @@ namespace SixLabors.ImageSharp.ParallelUtils } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int DivideCeil(int dividend, int divisor) - { - // TODO: Is there a more efficient way to calculate this? - int result = dividend / divisor; - return dividend % divisor == 0 ? result : result + 1; - } + private static int DivideCeil(int dividend, int divisor) => 1 + ((dividend - 1) / divisor); } } \ No newline at end of file