Browse Source

fix typo, improve DivideCeil

pull/710/head
Anton Firszov 8 years ago
parent
commit
0c42925a05
  1. 2
      src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs
  2. 7
      src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs

2
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.
/// </summary>
/// <typeparam name="TPixelDst">The pixel format of destination image.</typeparam>
/// <typeparam name="TPixelSrc">The pixel format os source image.</typeparam>
/// <typeparam name="TPixelSrc">The pixel format of source image.</typeparam>
internal class DrawImageProcessor<TPixelDst, TPixelSrc> : ImageProcessor<TPixelDst>
where TPixelDst : struct, IPixel<TPixelDst>
where TPixelSrc : struct, IPixel<TPixelSrc>

7
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);
}
}
Loading…
Cancel
Save