On 25.11.2015 4:31, Andrey Chernov wrote:
> 4) The whole processing looks overcomplicated and not effective. What
> about this instead?
> for (i = 0; i < 12; i++) {
>     count wcswidth() of each month and store it in wab_months_width[].
>     count max_width_month.
> }
> for (i = 0; i < 12; i++) {
>     if ((n = max_width_month - wab_months_width[i]) > 0)
>       call wcscat(wab_months[i], L" ") n times.
> }

Last line can be optimized further:
wcslcat(wab_months[i], L"     "/* MAX_ABMON_WIDTH */, n);

-- 
http://ache.vniz.net/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to