Browse Source

Yet another docs fixes

pull/1663/head
Dmitry Pentin 5 years ago
parent
commit
ab8f727f97
  1. 2
      src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanScanEncoder.cs

2
src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanScanEncoder.cs

@ -409,11 +409,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder
// BitOperations.Log2 implementation also checks if input value is zero for the convention
// As this is a very specific method for a very specific Huffman encoding code
// We can omit zero check as this should not be invoked with value == 0 and guarded in debug builds
// This is also marked as internal so every use of this would be tracable & testable in tests
return 32 - System.Numerics.BitOperations.LeadingZeroCount(value);
#else
// On the contrary to BitOperations implementation this does follow the convention and supports value == 0 case
// Although it's still won't be called with value == 0
// As these implementations behave differently for the value == 0 case it's documented as undefined behaviour
return Numerics.Log2SoftwareFallback(value) + 1;
#endif
}

Loading…
Cancel
Save