On Sat, Oct 17, 2015 at 06:49:14PM +0200, Pierre Neidhardt wrote:
On 15-10-17 09:11:02, Dave Reisner wrote:
On Sat, Oct 17, 2015 at 12:04:11PM +0200, Pierre Neidhardt wrote:
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> +#define TITLE_MAXLEN 64
Surely, you examined the POT files to determine this value. Could you leave behind a comment explaining as much so that it's clear what this relates to for future readers?
Actually I did! :) Longest title string is less than 26 characters long. But you are right, I will add a comment in the next patch.
This raises a good question however: what would be a good maximum value for titles? (Titles longer than TITLE_MAXLEN get truncated.)
Well, it's a bit of a misfeature, IMO. Have you run a benchmark to determine that heap allocating the right amount is substantially slower or more complicated than keeping it on the stack? After all, this code is only run once, so I'm a little skeptical that we gain anything in exchange to bearing the maintenance cost of this magic value.
-- Pierre Neidhardt
Mind your own business, then you don't mind mine.