madler / zlib

A massively spiffy yet delicately unobtrusive compression library.
http://zlib.net/
Other
5.71k stars 2.45k forks source link

Remove calculation of unused pointer value #839

Closed irwir closed 9 months ago

irwir commented 1 year ago

Safe to remove because this local pointer was never used afterwards,

madler commented 9 months ago

Thank you. Sure, but we can leave that optimization to the compiler. The code is consistent and readable as written.

irwir commented 9 months ago

There is irony in creating additional job for compilers in hope for a non-guaranteed optimization. Unfortunately, this kind of consistency also creates warnings from static analysers and compilers.

If you think readability would suffer, then the line simply could be commented out; maybe with a clarification.