Closed ForeverZer0 closed 5 years ago
It is simply copy of the original C code. Check this line https://github.com/nothings/stb/blob/c72a95d766b8cbf5514e68d3ddbf6437ac9425b1/stb_image_write.h#L938
And then definition of macro stbiw__zlib_huff: https://github.com/nothings/stb/blob/c72a95d766b8cbf5514e68d3ddbf6437ac9425b1/stb_image_write.h#L851
I see, looks to be some macro-magic gone awry. Was trying compare against the C code with -E
passed to the compiler, but it is unintelligible.
Either way, doesn't hurt anything, just a few small unreachable branches in a large method, using cheap integer comparison. I haven't check the IL, it probably makes it a no-op anyways.
Was looking through the
StbImageWrite.Generated.cs
files, and noticed this...I am going to assume this portion did not generate correctly, as
256
is never going to be less than143
or255
, and always be less than279
.