Browse Source
elide further bound checks
Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1773/head
Anton Firszov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromGrayScaleBasic.cs
|
|
@ -37,11 +37,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters |
|
|
float scaleValue = 1f / maxValue; |
|
|
float scaleValue = 1f / maxValue; |
|
|
values[0] *= scaleValue; |
|
|
values[0] *= scaleValue; |
|
|
|
|
|
|
|
|
if (values.Length > 1) |
|
|
if ((uint)values.Length > 1) |
|
|
{ |
|
|
{ |
|
|
values[1] *= scaleValue; |
|
|
values[1] *= scaleValue; |
|
|
|
|
|
|
|
|
if (values.Length > 2) |
|
|
if ((uint)values.Length > 2) |
|
|
{ |
|
|
{ |
|
|
values[2] *= scaleValue; |
|
|
values[2] *= scaleValue; |
|
|
} |
|
|
} |
|
|
|