Re: [PATCH] Add checks for new and tmp directories to mx_is_maildir()

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aYVGsFeH5XSg1KKL@qinghai>
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. :D

However, 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 (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmmFRrAACgkQre92hIAx
a9qERhAAxZZgOg+0ZSzNbUV42Lj55yG1U9AoSWxBEZQWkq9iklOx4JJvrivF2Ed0
bc6/MyN+NeY14VcxDytyj0jfduTBpLw/8R1Sg6AV7Zk9H1TIT0hTr6iDN57aKuFU
dWAVQn318PvkYrHImCZ+mmtjRR4JWROEeatMGnpRdaBKzgG83CaVKGjfnbrjViIU
7GBEkGM2NG5EKGewkUgUEJJHjoxUkYpBzkCA8qjEStjBHR/HyDkka62U6EFUvMCi
q25AZl/Whu5TQnbLrdBKHwIW1sTwI9pLWMfZ+Yo8A/4pPfqyEAEtTzSYvjvCqc6k
WjzlprcOPW/xJKzPbpPzMBFhIM626aZyyR67frGNF5yeF5HJz0Q5bB4WSOAuHtZN
LH8B9d8P50+XUzjsT8RaLC3TvNhv9ZXrNcnDhs34NJ5uZHRyyWaFdlQCi7wyqQME
kumAf82y5AoAFMjS7qNL8stJSC2WigFJrQBChrldPOm/GEgl1b5/AUhJJod8QdsT
ZvWHLvhwerpne5PqCLTyXp1RiIOq95UfiRAaAoj+qUYNpAqC00lmMdSjBBDxMR/k
3ENTa+Mnckp4fek81OnXFXJtsMs08AfW5wXQJlqvbLTTt8q/TnmoReAfvTHvUylm
+cQmJGIRulG9+lwiOj9gT89OBTPC2U7RFGoZMOQP+UHerVjIQuI=
=tslE
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.