Re: [PATCH] macos: lazily initialize iconv

2012-07-31 Thread Junio C Hamano
Ralf Thielow writes: > On Tue, Jul 31, 2012 at 7:52 PM, Junio C Hamano wrote: >> + /* Avoid iconv_open()/iconv_close() if there is nothing to convert */ >> + for (i = 0; i < argc; i++) { >> + if (has_utf8(argv[i], (size_t)-1, NULL)) >> + break; >>

Re: [PATCH] macos: lazily initialize iconv

2012-07-31 Thread Ralf Thielow
On Tue, Jul 31, 2012 at 7:52 PM, Junio C Hamano wrote: > + /* Avoid iconv_open()/iconv_close() if there is nothing to convert */ > + for (i = 0; i < argc; i++) { > + if (has_utf8(argv[i], (size_t)-1, NULL)) > + break; > + } > + if (i < ar

Re: [PATCH] macos: lazily initialize iconv

2012-07-31 Thread Junio C Hamano
Junio C Hamano writes: > In practice, the majority of paths do not have any utf8 character > that needs the canonicalization. Lazily call iconv_open() and > iconv_close() to avoid unnecessary overhead. > > Signed-off-by: Junio C Hamano > --- > > * This is not even compile tested, so it needs t

[PATCH] macos: lazily initialize iconv

2012-07-31 Thread Junio C Hamano
In practice, the majority of paths do not have any utf8 character that needs the canonicalization. Lazily call iconv_open() and iconv_close() to avoid unnecessary overhead. Signed-off-by: Junio C Hamano --- * This is not even compile tested, so it needs testing and benchmarking, as I do not