Re: [PATCH] Add checks for new and tmp directories to mx_is_maildir()
Alejandro Colomar via Mutt-dev <[email protected]>
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <aYXuJdjZJel0urvM@devuan> |
Hi, On 2026-02-06T14:29:34+0100, Milan Straka wrote: > Hi all, > > > -----Original message----- > > From: "Kevin J. McCarthy" <[email protected]> > > Sent: 6 Feb 2026, 09:41 > > > > 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. > > personally I see it the same way, considering readability and simplicity > a big priority; parsing the proposed version is (at least for me) much > harder than the original version. +1 Except that maybe with fstatat(2) (as Crystal said) it could be readable --we'd have to see the code, though--. readability >>> optimizations Have a lovely day! Alex > > Cheers, > Milan S. -- <https://www.alejandro-colomar.es>
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIyBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmmF7p8ACgkQ64mZXMKQ wqmxgg/3Tz1Fg4wrydzCGhJtz55+XKQXb32BnG288a8nazvq5VeC1DIpvI4nLrYL hKlsjkkJrGXy2z8ZWDZPwZnpLtKO45rzHIEkP24M+81VXllI2aDL2Hlx5jWw9Iyn lGSiDtkbsI0xGihhLeyw7j2L7o/4H9kKYXcIQ7GTWmRPTLK855m4l4ELf8CXIbL9 vYjl9bXzNV0llsEC4Ko85/z+w8L9MTT1OPA8ybiBDMdUCF1hYmqkd4hazRSAwl7n rnbRR/FnDFgj5A1FnF2JHrChdV1s2kzEm3kB0e0ZFz1QcIuGZs+vUTeZIgXXpbV6 UemaRzCFD24CyR3rpDr212srjXJg87k0TJrEmj8Z8wb06cvX+EUtEHFJF+BIJR9E Doaje49HvRqJPPF4BnKsAY8ucxsV9ufKpswXFaOQGmvQp/e9qbiji9w8+Zm4GnTp 9xMbtDOOqBCvVet5kzdrxfqcujNmxzf9vJZcY6pu0UcA1tildPO0XPEp5Y0kbIW3 j2vXF9wvaguWJz9y6UKh7T76d2eTPwS2Z3W5ZNb8/cszapm7O93LRJ/Kt/Ypmlew 7G2NGyFr5dkWNWRcXmCoO59MrTc43GghP0GVx2auWDa/iXr95eLm0qLX+/07refT xHg093B00uJpvJiZ6v2oPl3OaZnQOBepD8O3OhRd+6XzOXYQPg== =jteO -----END PGP SIGNATURE-----