Re: [PATCH V2] localcharset: short-circuit the search for an alias on a Mac

2018-04-21 Thread Bruno Haible
Hi Benno,

> * lib/localcharset.c (get_charset_aliases): Add a tautological
> UTF-8 entry to speed up the search for this case.
> 
> Most machines default to a UTF-8 locale nowadays, so begin the
> list of aliases with a dummy UTF-8 entry so it will be found
> immediately and a time-consuming search through the rest of
> the list is avoided.

Thanks, applied.

I added a comment.
Explanations about the code belong in the code, as comments, IMO.
Readers of the code should not be forced to constantly refer to
ChangeLog entries and commit messages in order to understand the code.

Bruno




Re: [PATCH V2] localcharset: short-circuit the search for an alias on a Mac

2018-04-21 Thread Benno Schulenberg

Hi Bruno,

Op 21-04-18 om 12:41 schreef Bruno Haible:
> Thanks, applied.

(For some background: a bug reporter found that on a Mac lots of
time would be spent in locale_charset() when nano called wcwidth():
https://savannah.gnu.org/bugs/?53562#comment16.)

> I added a comment.
> Explanations about the code belong in the code, as comments, IMO.
> Readers of the code should not be forced to constantly refer to
> ChangeLog entries and commit messages in order to understand the code.

True.  Much better this way.  Thanks.

Benno