]> git.lyx.org Git - lyx.git/commitdiff
- 5% speed-up by reserving space in the vector we build for drawing
authorAsger Ottar Alstrup <alstrup@lyx.org>
Sun, 22 Oct 2006 13:51:37 +0000 (13:51 +0000)
committerAsger Ottar Alstrup <alstrup@lyx.org>
Sun, 22 Oct 2006 13:51:37 +0000 (13:51 +0000)
- Simplify isPrintableNonspace

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15475 a592a061-630c-0410-9148-cb99ea01b6c8

src/rowpainter.C
src/support/textutils.h

index 4f0fecfa2270f310d32d1ed1f239cec91bc48fbc..7be384bfdff366361a7330603aaf53a59fcab058 100644 (file)
@@ -267,6 +267,7 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont font,
        str += par_.getChar(pos);
 #else
        std::vector<char_type> str;
+       str.reserve(100);
        str.push_back(par_.getChar(pos));
 #endif
        if (arabic) {
index 40521ec461b928659229b02c1394b80d5a4048a8..c0f3850a6c04938ec05e8091a5d9e13a486fd47c 100644 (file)
@@ -50,7 +50,7 @@ bool isPrintable(lyx::char_type c)
 inline
 bool isPrintableNonspace(lyx::char_type c)
 {
-       return isPrintable(c) && c != ' ';
+       return (c & 127) > ' ';
 }
 
 /// return true if a unicode char is a digit.