source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Avoid running the "width" termp callback for each whitespace.
@ 2010-07-25 22:56 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-07-25 22:56 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-25 22:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-25 22:56 mdocml: Avoid running the "width" termp callback for each whitespace kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).