From 5c85bf0c640a281cdd232b69f53f1de9e95f20ef Mon Sep 17 00:00:00 2001 From: Asger Ottar Alstrup Date: Sun, 22 Oct 2006 13:51:37 +0000 Subject: [PATCH] - 5% speed-up by reserving space in the vector we build for drawing - Simplify isPrintableNonspace git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15475 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/rowpainter.C | 1 + src/support/textutils.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rowpainter.C b/src/rowpainter.C index 4f0fecfa22..7be384bfdf 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -267,6 +267,7 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont font, str += par_.getChar(pos); #else std::vector str; + str.reserve(100); str.push_back(par_.getChar(pos)); #endif if (arabic) { diff --git a/src/support/textutils.h b/src/support/textutils.h index 40521ec461..c0f3850a6c 100644 --- a/src/support/textutils.h +++ b/src/support/textutils.h @@ -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. -- 2.39.2