From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o6PMul0K006742 for ; Sun, 25 Jul 2010 18:56:47 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o6PMuldJ029510; Sun, 25 Jul 2010 18:56:47 -0400 (EDT) Date: Sun, 25 Jul 2010 18:56:47 -0400 (EDT) Message-Id: <201007252256.o6PMuldJ029510@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Avoid running the "width" termp callback for each whitespace. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Avoid running the "width" termp callback for each whitespace. Modified Files: -------------- mdocml: term.c Revision Data ------------- Index: term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v retrieving revision 1.163 retrieving revision 1.164 diff -Lterm.c -Lterm.c -u -p -r1.163 -r1.164 --- term.c +++ term.c @@ -242,10 +242,10 @@ term_flushln(struct termp *p) if ('\t' == p->buf[i]) break; if (' ' == p->buf[i]) { - while (' ' == p->buf[i]) { - vbl += (*p->width)(p, p->buf[i]); + j = i; + while (' ' == p->buf[i]) i++; - } + vbl += (i - j) * (*p->width)(p, ' '); break; } if (ASCII_NBRSP == p->buf[i]) { -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv