On Thu, Feb 05, 2026 at 02:57:47AM +0100, Gero Treuner wrote:
Out of curiosity I rewrote it to iterate over the three subdirectory names and compared the difference in size of the binaries. In this case it apparently is dominated by (debug) symbols and not hitting a threshold for reduced size of a fully stripped binary on my system.So having done this anyway, I propose an optimization utilizing the uniform length of the names. (Further compacting the code saves more space but degrades readability of the logic.)
Thanks Gero! I certainly agree it's more optimized. :DHowever, I personally argue for code clarity except when optimization is called for. In this case, I don't think it's worth the trade off. See just below the function in mh.c, mx_is_mh(), for similar code, also called by mx_get_magic().
As always, if others disagree please just say so. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature
